- <html>
- <head>
- <mce:script type="text/javascript"><!--
- function CTest(width, height)
- {
- this.m_nWidth=width;
- this.m_nHeight=height;
- }
- CTest.prototype=
- {
- m_nWidth: 0,
- m_nHeight: 0,
-
- m_pfnPrintInfo: function()
- {
- var strInfo = "";
- strInfo += "width = " + this.m_nWidth + "/theight = " + this.m_nHeight + "\n";
-
- alert(strInfo);
- }
- };
-
- var objT1 = new CTest(1, 2);
- var objT2 = new CTest(12.3, 45.6);
-
- objT1.m_pfnPrintInfo();
- objT2.m_pfnPrintInfo();
-
-
- </head>
- <body onload="">
- <h1><font color="#ff0000">Test for new Object </font></h1>
- </body>
- </html>
摘自:http://blog.csdn.net/andylin02/article/details/4297681