JavascriptÔÚÍøÒ³µÄÒ³Ãæ¼ÓÔØʱִÐеÄ˳Ðò
Ò»¡¢ÔÚHTMLÖÐǶÈëJavasriptµÄ·½·¨
1¡¢Ö±½ÓÔÚJavascript´úÂë·ÅÔÚ±ê¼Ç¶Ô<script>ºÍ</script>Ö®¼ä
2¡¢ÓÉ<script. />±ê¼ÇµÄsrcÊôÐÔÖƶ¨ÍⲿµÄjsÎļþ
3¡¢·ÅÔÚʼþ´¦Àí³ÌÐòÖУ¬±ÈÈ磺<p nclick="alert('ÎÒÊÇÓÉonclickʼþÖ´ÐеÄJavascript')">µã»÷ÎÒ</p>
4¡¢×÷ΪURLµÄÖ÷Ì壬Õâ¸öURLʹÓÃÌØÊâµÄJavascript£ºÐÒ飬±ÈÈ磺<a href="javascript.:alert('ÎÒÊÇÓÉjavascript.:ÐÒéÖ´ÐеÄjavascript')">µã»÷ÎÒ</a>
5¡¢ÀûÓÃjavascript±¾ÉíµÄdocument.write()·½·¨Ð´ÈëеÄjavascript´úÂë
6¡¢ÀûÓÃAjaxÒì²½»ñÈ¡javascript´úÂ룬ȻºóÖ´ÐÐ
µÚ3Öֺ͵Ú4ÖÖ·½·¨Ð´ÈëµÄJavascriptÐèÒª´¥·¢²ÅÄÜÖ´ÐУ¬ËùÒÔ³ý·ÇÌرðÉèÖ㬷ñÔòÒ³Ãæ¼ÓÔØʱ²»»áÖ´ÐС£
¶þ¡¢JavascriptÔÚÒ³ÃæµÄÖ´ÐÐ˳Ðò
1¡¢ Ò³ÃæÉϵÄJavascript´úÂëÊÇHTMLÎĵµµÄÒ»²¿·Ö£¬ËùÒÔJavascriptÔÚÒ³Ãæ×°ÔØʱִÐеÄ˳Ðò¾ÍÊÇÆäÒýÈë±ê¼Ç<script. />µÄ³öÏÖ˳Ðò£¬ <script. />±ê¼ÇÀïÃæµÄ»òÕßͨ¹ýsrcÒýÈëµÄÍⲿJS£¬¶¼ÊÇ°´ÕÕÆäÓï¾ä³öÏÖµÄ˳ÐòÖ´ÐУ¬¶øÇÒÖ´Ðйý³ÌÊÇÎĵµ×°ÔصÄÒ»²¿·Ö¡£
2¡¢Ã¿¸ö½Å±¾¶¨ÒåµÄÈ«¾Ö±äÁ¿ºÍº¯Êý£¬¶¼¿ÉÒÔ±»ºóÃæÖ´ÐеĽű¾Ëùµ÷Óá£
3¡¢±äÁ¿µÄµ÷Ó㬱ØÐëÊÇÇ°ÃæÒѾÉùÃ÷£¬·ñÔò»ñÈ¡µÄ±äÁ¿ÖµÊÇundefined¡£
<script. type="text/javscrpt">//<![CDATA[
alert(tmp); //Êä³ö undefined
var tmp = 1;
alert(tmp); //Êä³ö 1
//]]></script>
4¡¢Í¬Ò»¶Î½Å±¾£¬º¯Êý¶¨Òå¿ÉÒÔ³öÏÖÔÚº¯Êýµ÷ÓõĺóÃ棬µ«ÊÇÈç¹ûÊÇ·Ö±ðÔÚÁ½¶Î´úÂ룬ÇÒº¯Êýµ÷ÓÃÔÚµÚÒ»¶Î´úÂëÖУ¬Ôò»á±¨º¯Êý䶨Òå´íÎó¡£
<script. type="text/javscrpt">//<![CDATA[
aa(); //ä¯ÀÀÆ÷±¨´í
//]]></script>
<script. type="text/javscrpt">//<![CDATA[
aa(); //Êä³ö 1
function aa(){alert(1);}
//]]></script>
5¡¢document.write()»á°ÑÊä³öдÈëµ½½Å±¾ÎĵµËùÔÚµÄλÖã¬ä¯ÀÀÆ÷½âÎöÍêdocumemt.write()ËùÔÚÎĵµÄÚÈݺ󣬼ÌÐø½âÎödocument.write()Êä³öµÄÄÚÈÝ£¬È»ºóÔÚ¼ÌÐø½âÎöHTMLÎĵµ¡£
<script. type="text/javascript">//<![CDATA[
document.write('<script. type="text/javascript" src="test.js"><\/script>');
document.write('<script. type="text/javascript">');
document.write('alert(2);'
Ïà¹ØÎĵµ£º
http://javascript.crockford.com/private.html
function a() {
var i = 0;
function b() {
alert(++i);
}
return b;
}
var c = a();
c();
µ±ÔÚº¯ÊýbÖзÃÎÊÒ»¸ö±äÁ¿µÄʱºò£¬ËÑË÷˳ÐòÊÇ£º
ÏÈËÑË÷×ÔÉíµÄ»î¶¯¶ÔÏó£¬Èç¹û´æÔÚÔò·µ»Ø£¬Èç¹û²»´æÔÚ½«¼ÌÐøËÑË÷º¯ÊýaµÄ»î¶¯¶ÔÏó£¬ÒÀ ......
function MyObject1(formalParameter){
alert("MyObject1");
this.testNumber = formalParameter;
//1
this.toString= function(){
alert("MyObject1:"+this.testNumber);
&nbs ......
//»ñÈ¡ä¯ÀÀÆ÷µÄ¿íºÍ¸ß£¨¶àÖÖä¯ÀÀÆ÷£©
function getNavWidthandHeightInfo()
{
var s = "";
s += " ÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
s += " ÍøÒ³¿É¼ûÇøÓò¸ß£º"+  ......
ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture();
event.srcElement.releaseCapture();
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
eve ......
ÏÂÃæµÄ²Ù×÷²½ÖèÃèÊöÁËÔõÑùÀûÓÃvs.netÖеĵ÷ÊÔÆ÷À´µ÷ÊÔjavascript£º
1,Ê×ÏÈ£¬ÒªÈÃÄãµÄieÔÊÐíµ÷ÊԽű¾£¬¾ßÌå²½ÖèÈçÏÂ:
´ò¿ªie->¹¤¾ß²Ëµ¥->interÑ¡Ïî->¸ß¼¶Ñ¡Ï->È¥µô“½ûÖ¹½Å±¾µ÷ÊÔ"Ñ¡Ïî
2,´ò¿ªvs.net,´´½¨Ò»¸öеÄasp.netÏîÄ¿(»ò´ò¿ªÒ»¸ö)
3,ÔËÐÐÄãÒªµ÷ÊÔµÄÒ³Ãæ
4,µ±ÄãµÄÒ³Ãæ³ÊÏÖÔÚieÀ ......