Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : javascript

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

2007-10-24 23:55
1£®ÔÚCOM×é¼þÖе÷ÓÃJavaScriptº¯Êý
// Á¬½Óµã·½Ê½Ò³Ãæjavascript½Å±¾
<object classid="CLSID:B568F111-DFE4-4944-B67F-0728AB2AB30F" id="testCom" VIEWASTEXT></object>
<script language="JavaScript" for="testCom" event="staTe(s)">
        alert("State(" + s + ")");
        return 123;
</script>
<script language="JavaScript">
        testCom.FireStateEvent("Hello");
</script>
// ʼþÊôÐÔ·½Ê½Ò³Ãæjavascript½Å±¾
function onState(s){
        alert("onState(" + s + ")");
        return 456;
}
var o = new ActiveXObject("TestATL.TestCom");
o.onstaTe=onState;
o.FireStateEvent("Hello");
// Com×é¼þVC7.1 ATL´úÂë
__interface _ITestComEvents{
        [id(1), helpstring("Stateʼþ")] HRESULT State([in] BSTR str);
};
__event __in ......

javascriptʵÏּ̳еÄÁ½ÖÖ·½·¨

(Ò»)¶ÔÏóð³ä
function A(name){
    this.name = name;
    this.sayHello = function(){alert(this.name+” say Hello!”);};
}
function B(name,id){
    this.temp = A;
    this.temp(name);        //Ï൱ÓÚnew A();
    delete this.temp;        //·ÀÖ¹ÔÚÒÔºóͨ¹ýtempÒýÓø²¸Ç³¬ÀàAµÄÊôÐԺͷ½·¨
     this.id = id;   
    this.checkId = function(ID){alert(this.id==ID)};
}
µ±¹¹Ôì¶ÔÏóBµÄʱºò£¬µ÷ÓÃtempÏ൱ÓÚÆô¶¯AµÄ¹¹Ô캯Êý£¬×¢ÒâÕâÀïµÄÉÏÏÂÎÄ»·¾³ÖеÄthis¶ÔÏóÊÇBµÄʵÀý£¬ËùÒÔÔÚÖ´ÐÐA¹¹Ô캯Êý½Å±¾Ê±£¬ËùÓÐAµÄ±äÁ¿ºÍ·½·¨¶¼»á¸³Öµ¸øthisËùÖ¸µÄ¶ÔÏ󣬼´BµÄʵÀý£¬ÕâÑù×ӾʹﵽB¼Ì³ÐÁËAµÄÊôÐÔ·½·¨µÄÄ¿µÄ¡£Ö®ºóɾ³ýÁÙʱÒýÓÃtemp£¬ÊÇ·Àֹά»¤BÖжÔAµÄÀà¶ÔÏó£¨×¢Òâ²»ÊÇʵÀý¶ÔÏ󣩵ÄÒýÓøü¸Ä£¬ÒòΪ¸ü¸Ätemp»áÖ±½Óµ¼ÖÂÀàA£¨×¢Òâ²»ÊÇÀàAµÄ¶ÔÏ󣩽ṹµÄ±ä»¯¡£
ÎÒÃÇ¿´µ½ÁË£¬ÔÚJs°æ±¾¸üеĹý³ÌÖУ¬ÎªÁ˸ü·½±ãµÄÖ´ÐÐÕâÖÖÉÏÏÂÎÄthisµÄÇл»Ò ......

dz̸JavaScriptµÄArray¶ÔÏó

        Array×÷ΪJavaScriptµÄÒ»¸öÄÚÖöÔÏó£¬ÓÐ×ÅÇ¿´óµÄ¹¦ÄÜ£»Ïà¶ÔÓÚÆäËûÄÚÖöÔÏóÀ´Ëµ£¬ËûÓÐ×ÅÌØÊâµÄÓ÷¨£¬ÏÂÃæ¶Ô˵˵×Ô¼º¶ÔArrayµÄÓ÷¨µÄÒ»¸öС×ܽ᣺
1>ÓÃ;һ£ºÊý×é
    Êý×é×î´ó´æ´¢Êý¾ÝΪËÄÊ®¶àÒÚ¸ö£¬Õâ¸ö¿Õ¼ä×ã¹»ÓÃÁË£¬ËùÒÔÊý×é¿ÉÒÔËæ±ãµÄÀ©ÈÝ¡£ÏÂÃæ¶Ô³£Óõķ½·¨½øÐÐ×ܽᣬÈçÏ£º
    
<!--´´½¨Êý×éµÄ·½Ê½-->
var array1 = new Array;
var array2 = new Array(2);
var array3 = new Array("green","red","blue");
var array4 = ["one","two","three"];
<!--¶ÔÊý×éµÄ²Ù×÷,ÌáʾËùÓвÙ×÷ÊǶÔÔ­arrayµÄ²Ù×÷-->
array3.length // 3
array3.toString() // green,red,blue
array3.valueOf() // green,red,blue
array3.join() // green,red,blue
array3.join("") // green red blue
array3.join("-") // green-red-blue
array3.shift() // red,blue
array3.unshift("black") // black,green,red,blue
<!--Êý×é×îÓÐ×Ô¶¯À©ÈݵŦÄÜ-->
array2.length // 2
array2[28] = "aa"; array2.length // 29
array2.shif ......

ʹÓÃjavascript¶¯Ì¬Ìí¼ÓºÍɾ³ýtableµÄÐкÍÁÐ

µÚÒ»ÖÖ·½·¨£ºÊ¹ÓÃinsertRowÌí¼ÓÐУ¬Ê¹ÓÃinsertCellÌí¼Óµ¥Ôª¸ñ£¬ÔÙÓÃinnerHTMLÌî³äµ¥Ôª¸ñ¡£Ê¹ÓÃdeleteRowɾ³ýÐУ¬´úÂëÈçÏ£º
Javascript´úÂ룺
function addRow()
  {
     var root = document.getElementById("tbody")
     var allRows = root.getElementsByTagName('tr');
     var allCells = allRows[0].getElementsByTagName('td');
     var newRow = root.insertRow();
     var newCell0 = newRow.insertCell();
     var newCell1 = newRow.insertCell();
     var newCell2 = newRow.insertCell();
     var newCell3 = newRow.insertCell();
     newCell0.innerHTML = allCells[0].innerHTML;
     newCell1.innerHTML  ......

javascriptͼƬä¯ÀÀÆ÷µÄºËÐÄ——ͼƬԤ¼ÓÔØ

javascriptͼƬä¯ÀÀÆ÷µÄºËÐÄ——ͼƬԤ¼ÓÔØ
2009-04-06 10:57
      ÍøÕ¾¿ª·¢Ê±¾­³£ÐèÒªÔÚij¸öÒ³ÃæÐèҪʵÏÖ¶Ô´óÁ¿Í¼Æ¬µÄä¯ÀÀ£¬Èç¹û¿¼ÂÇÁ÷Á¿µÄ»°£¬´ó¿ÉÒÔÏñpconlineÒ»Ñùÿ¸öÒ³ÃæÖ»ÏÔʾһÕÅͼƬ£¬ÈÃÓû§Ã¿¿´Ò»ÕÅͼƬ¾ÍÐèÒªÖØÐÂÏÂÔØÒ»ÏÂÕû¸öÒ³Ãæ¡£²»¹ý£¬ÔÚweb2.0ʱ´ú£¬¸ü¶àÈËÔ¸ÒâÓÃjavascriptÀ´ÊµÏÖÒ»¸öͼƬä¯ÀÀÆ÷£¬ÈÃÓû§ÎÞÐèµÈ´ý¹ý³¤µÄʱ¼ä¾ÍÄÜ¿´µ½ÆäËûͼƬ¡£
      ÖªµÀÁËÒ»ÕÅͼƬµÄµØÖ·£¬ÐèÒª°ÑËüÔÚÒ»¸ö¹Ì¶¨´óСµÄhtmlÈÝÆ÷£¨¿ÉÒÔÊÇdivµÈ£©Àï±ßÏÔʾ³öÀ´£¬×îÖØÒªµÄµ±È»ÊÇÐèÒªÖªµÀÕâÕż´½«ÏÔʾµÄͼƬµÄ¿íºÍ¸ß£¬È»ºóÔÙ½áºÏÈÝÆ÷µÄ¿íºÍ¸ß£¬°´ÕÕÒ»¶¨µÄËõ·Å±ÈÀýʹͼƬÏÔʾ³öÀ´¡£Òò´Ë£¬ÊµÏÖͼƬԤ¼ÓÔؾͳÉΪͼƬä¯ÀÀÆ÷µÄºËÐŦÄÜÁË¡£
      ×ö¹ýͼƬ·­×ªÐ§¹ûµÄÅóÓÑÆäʵ¶¼ÖªµÀ£¬ÒªÈÃͼƬÂÖ»»µÄʱºò²»³öÏֵȴý£¬×îºÃÊÇÏÈÈÃͼƬÏÂÔص½±¾µØ£¬ÈÃä¯ÀÀÆ÷»º´æÆðÀ´¡£Õâʱ£¬Ò»°ã¶¼»áÓõ½jsÀï±ßµÄImage¶ÔÏó¡£Ò»°ãµÄÊÖ¶ÎÎÞ·ÇÕâÑù£º
function preLoadImg(url) {
var img = new Image();
img.src = url;
}
      ͨ¹ýµ÷ÓÃpreLoadImgº¯Êý£¬´«ÈëͼƬµÄurl£¬¾ÍÄÜʹͼƬԤÏÈ ......

javascriptµÄwindows.open²ÎÊýѧϰ


<SCRIPT LANGUAGE="javascript">
<!--
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
file://д/³ÉÒ»ÐÐ
-->
</SCRIPT>
²ÎÊý½âÊÍ£º
<SCRIPT LANGUAGE="javascript"> js½Å±¾¿ªÊ¼£»
window.open µ¯³öд°¿ÚµÄÃüÁ
'page.html' µ¯³ö´°¿ÚµÄÎļþÃû£»
'newwindow' µ¯³ö´°¿ÚµÄÃû×Ö£¨²»ÊÇÎļþÃû£©£¬·Ç±ØÐ룬¿ÉÓÿÕ''´úÌ棻
height=100 ´°¿Ú¸ß¶È£»
width=400 ´°¿Ú¿í¶È£»
top=0 ´°¿Ú¾àÀëÆÁÄ»ÉÏ·½µÄÏóËØÖµ£»
left=0 ´°¿Ú¾àÀëÆÁÄ»×ó²àµÄÏóËØÖµ£»
toolbar=no ÊÇ·ñÏÔʾ¹¤¾ßÀ¸£¬yesΪÏÔʾ£»
menubar£¬scrollbars ±íʾ²Ëµ¥À¸ºÍ¹ö¶¯À¸¡£
resizable=no ÊÇ·ñÔÊÐí¸Ä±ä´°¿Ú´óС£¬yesΪÔÊÐí£»
location=no ÊÇ·ñÏÔʾµØÖ·À¸£¬yesΪÔÊÐí£»
status=no ÊÇ·ñÏÔʾ״̬À¸ÄÚµÄÐÅÏ¢£¨Í¨³£ÊÇÎļþÒѾ­´ò¿ª£©£¬yesΪÔÊÐí£»
</SCRIPT>
......
×ܼǼÊý:2244; ×ÜÒ³Êý:374; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [361] [362] [363] [364] 365 [366] [367] [368] [369] [370]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ