Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Javascript ÀàºÍÃüÃû¿Õ¼äµÄ¶¨Òå

//1.Àà
function Test(id)
{
     this.id=id;
     this.method=function()
         {
            //´úÂë
         };
}
//¿ÉÒÔ¼ÌÐøÀ©Õ¹ÉÏÃæµÄ·½·¨£º
Test.prototype.method1=function(){};
//µ÷ÓÃдºÃµÄÀà  var A = new Test("1");
//2.JSÃüÃû¿Õ¼ä
var namespace={};//var namespace=new Object();
o.i=4;
o.method1=function(){};
//ÎÒµÄÏë·¨ÊÇ£º¾ÍÊÇÀûÓÃobjectÌØÐÔ£¬¿ÉÒÔÌí¼Ó×Ô¼ºµÄ·½·¨ºÍ±äÁ¿£¬´Ó¶ø´ïµ½·½±ãÉèÖÃÃüÃû¿Õ¼äµÄÄ¿µÄ£»
//ÏÂÃæÊÇÍøÉϵÄÒ»¸ö·½·¨£¬ÎÒ¾õµÃÕâ¸ö±È½Ï·½±ã£¬ÌرðÊÇÃüÃû¿Õ¼äµÄ²ã´Î±È½Ï¶àµÄʱºò£¬ÓÃÕâ¸öÈ¥×¢²á£¬·Ç³£¿ì
<script language="javascript" type="text/javascript">
// Namespace
Namespace =
new
Object();
// register"Grandsoft.GEA"
Namespace.register =
function
(fullNS)
{
// N, GrandsoftGEA
var nsArray = fullNS.split('.'
);
var sEval = ""
;
var sNS = ""
;
for (var
i = 0; i < nsArray.length; i++)
{
if (i != 0) sNS += "."
;
sNS += nsArray[i];
//
// GrandsoftGrandsoft.GEA
sEval +=
"if (typeof(" + sNS + ") == 'undefined') " + sNS +
" = new Object();"
}
if (sEval != ""
) eval(sEval);
}
//JavaScript
// Grandsoft.GEA, Grandsoft.GCM
Namespace.register(
"Grandsoft.GEA"
);
Namespace.register(
"Grandsoft.GCM"
);
// Grandsoft.GEAPerson
Grandsoft.GEA.Person =
function
(name, age)
{
this
.name = name;
this
.age = age;
}
// Personshow()
Grandsoft.GEA.Person.prototype.show =
function
()
{
alert(
this.name + " is " + this.age + " years old!"
);
}
// Person
var
p = new Grandsoft.GEA.Person("yanglf"
, 25);
window.onload = p.show;
</script>


Ïà¹ØÎĵµ£º

VS2005ÈçºÎµ÷ÊÔaspxÖÐJavaScript½Å±¾

Ê×ÏÈÉèÖÃIE,   ÒÀ´ÎÑ¡Ôñ ¹¤¾ß-> Internet   Ñ¡Ïî->   ¸ß¼¶, ÕÒµ½ ä¯ÀÀ ϵÄÁ½¸ö½ûÓýű¾µ÷ÊÔ¸´Ñ¡¿ò, ½«ÆäÈ¡ÏûÑ¡Ôñ(IEĬÈϽ«ÕâÁ½ÏîÑ¡ÖÐ, ²»ÄܽøÐнű¾µ÷ÊÔ), 
1. µ÷ÊÔJS½Å±¾Îļþ(*.jsÎļþ)
Ö±½ÓÔÚJSÎļþÖÐF9ÉèÖöϵã, F5ÔËÐе÷ÊÔ¼´¿É.
2. µ÷ÊÔÒ³ÃæÎļþÖнű¾(*.aspxÖÐJS½Å±¾) ......

js Åжϵ±Ç°ä¯ÀÀÆ÷JavaScriptµÄ°æ±¾

function RegExpTest(){
var ver = Number(ScriptEngineMajorVersion() + "." + ScriptEngineMinorVersion());
alert("version=="+ver);
if (ver >= 5.5){ // ²âÊÔ JScript µÄ°æ±¾¡£
var src = "The rain in Spain falls mainly in the plain.";
var re = /\w+/g; // ......

javascript ÏÂÀ­¿ò£¨select)Ñ¡ÔñÓ뱻ѡÔñ

<html>
<head>
<mce:script type = "text/javascript"><!--

function changetext()
{
var x = document.getElementById("list");
for (var i = 0;i < x.length;i++ )
{
if (x.options[i].selected)
{
document.getElemen ......

What can a JavaScript do?


JavaScript gives HTML designers a programming tool - HTML authors are normally not programmers, but JavaScript is a scripting language with a very simple syntax! Almost anyone can put small "snippets" of code into their HTML pages
JavaScript can put dynamic text into an HTML page - A Ja ......

javascriptÖеÄevalº¯ÊýµÄÓ÷¨(תÌù)

±¾ÎĵÄÁ½¸öÄ¿µÄ£º
£¨1£©½éÉÜjavascriptÖеÄevalº¯ÊýµÄÓ÷¨
£¨2£©ÈçºÎÔÚº¯ÊýÄÚÖ´ÐÐÈ«¾Ö´úÂë
►ÏÈÀ´ËµevalµÄÓ÷¨£¬ÄÚÈݱȽϼòµ¥£¬ÊìϤµÄ¿ÉÒÔÌø¹ý¡£
evalº¯Êý½ÓÊÕÒ»¸ö²ÎÊýs£¬Èç¹ûs²»ÊÇ×Ö·û´®£¬ÔòÖ±½Ó·µ»Øs¡£·ñÔòÖ´ÐÐsÓï¾ä¡£Èç¹ûsÓï¾äÖ´Ðнá¹ûÊÇÒ»¸öÖµ£¬Ôò·µ»Ø´ËÖµ£¬·ñÔò·µ»Øundefined¡£
ÐèÒªÌرð×¢ÒâµÄÊǶÔÏóÉùÃ÷Óï· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ