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

javascriptÈçºÎ¶¨ÒåÀà

javascriptÈçºÎ¶¨ÒåÀàÄØ£¿
ÃæÊÔµÄʱºòÓÐѧÉú±»Îʵ½Õâ¸öÎÊÌâ¡£
ʵ¼ÊÉÏjavascriptµÄ·½·¨¾ÍÊÇÒ»¸ö¶ÔÏó¡£
ÀûÓÃÕâÒ»µã£¬ÎÒÃÇ¿ÉÒÔʹÓÃjavascript¶¨ÒåÀà¡£
ÈçÏÂÀý×ÓËùʾ¡£
<mce:script language="javascript"><!--
//javascriptµÄÃæÏò¶ÔÏóµÄÀý×Ó
function sayHi(){
alert("Hello ,"+this.name);
}
function getAge(){
alert("my age:"+this.age);
}
function Student(name,age){
var tempStu=new Object;
//ÊôÐÔ
tempStu.name=name
tempStu.age=age;

//·½·¨
tempStu.sayHi=sayHi;
tempStu.getAge=getAge;
return tempStu;
}

var s =Student("jack",20);
s.sayHi();
s.getAge();
// --></mce:script>
¶¨ÒåÀàÓкü¸ÖÖ·½Ê½¡£ÒÔÉÏÖ»ÊÇÆäÖÐÒ»ÖÖ¡£´ó¼Ò¿ÉÒÔÔÚÈËÃñÓʵ磬¡¶javascript¸ß¼¶³ÌÐòÉè¼Æ¡·
Ò»ÊéÈ¥ÕÒµ½¸ü¶à·½·¨¡£


Ïà¹ØÎĵµ£º

javascript window.onload ´íÎó:ÉÐδʵÏÖ ½â¾ö°ì·¨

window.onload= someFunction();//Ò³Ã汨ÉÐδʵÏÖ´íÎóʱ²»·ÀÓÃÏÂÃæµÄÊÔһϠ  
window.onload = someFunction;    
window.onload = function (){someFunction();};    
window.onload = Function("someFunction();"); ......

ActiveX×é¼þÓëJavaScript½»»¥

1£®ÔÚCOM×é¼þÖе÷ÓÃJavaScriptº¯Êý
// Á¬½Óµã·½Ê½Ò³Ãæjavascript½Å±¾
<object classid="CLSID:B568F111-DFE4-4944-B67F-0728AB2AB30F"
id="testCom" VIEWASTEXT></object>
<script language="JavaScript" for="testCom" event="staTe(s)">
&nbs ......

javascript»ñÈ¡ÏÔʾÆ÷³ß´ç

ÒÔÏÂÊÂÀýΪ½áºÏ±¾È˵çÄÔ¶øÉè¼ÆµÄ²ÎÊý,ÄúÒ²¿É¸ÄΪ×Ô¼ºµÄ³ß´ç
<SCRIPT LANGUAGE="JavaScript">
var chicun;
chicun=screen.width;
if(chicun==1280||chicun==1440||chicun==1600)
{
<!--
function initEcAd() {
document.all.AdLayer1.style.posTop = -100;
document.all.AdLayer1.style.visibility = 'vis ......

JavaScriptÖÐsetAttributeÓ÷¨


ÎÒÃǾ­³£ÐèÒªÔÚJavaScriptÖиøElement¶¯Ì¬Ìí¼Ó¸÷ÖÖÊôÐÔ£¬Õâ¿ÉÒÔͨ¹ýʹÓÃsetAttribute()À´ÊµÏÖ£¬Õâ¾ÍÉæ¼°µ½ÁËä¯ÀÀÆ÷µÄ¼æÈÝÐÔÎÊÌâ¡£
setAttribute(string name, string value)£ºÔö¼ÓÒ»¸öÖ¸¶¨Ãû³ÆºÍÖµµÄÐÂÊôÐÔ£¬»òÕß°ÑÒ»¸öÏÖÓеÄÊôÐÔÉ趨Ϊָ¶¨µÄÖµ¡£
1¡¢ÑùʽÎÊÌâ
setAttribute(class, value)ÖÐclassÊÇÖ¸¸Ä±äclassÕâ¸öÊôÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ