<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled
Page</title>
<script type="text/javascript">
function
load() {
var
Agency = new function()
{
this.fname
= "";
this.lname
= "";
this.Street
= "";
this.country
= "";
this.website
= "";
this.AgencyDetail
= function() {
return
' First Name :: ' + this.fname
+ ' \n Last Name :: ' + this.lname + ' \n Address
:: ' + this.Street + ', ' + this.country
+ ' \n Website :: ' + this.website;
}
}
Agency.fname = 'Arun';
Agency.lname = 'Aravind';
Agency.country = 'India';
Agency.Street = 'Oyoor';
Agency.website = 'www.simplyasp.blogspot.com';
alert(Agency.AgencyDetail());
}
window.onload = load();
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
and the Output looks
This method is pretty helpful while looping in JavaScript and also for re-usability code too.
If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)
No comments:
Post a Comment