9 Şubat 2012 Perşembe

try javascript define object



<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
var myFunc=function(name){
this.name=name
};

myFunc.prototype = {
propFirst:null,
propSecond:0,

propFunc : function(msg){
this.propFirst = msg;
//this.name=msg;
alert(this.propSecond+" : "+this.name+ " : "+msg);
}

};


$(document).ready(function(){

var x = new myFunc("fName");

x.propFunc("shit");


});
</script>

</head>
<body>

</body>
</html>