javascript ÖÐÊý×éʹÓ÷½·¨»ã×Ü
/*
ÓÉÓÚjavascriptÊÇÒ»ÖÖÎÞÀàÐÍÓïÑÔ,ËùÒÔÒ»¸öÊý×éµÄÔªËØ¿ÉÒÔ¾ßÓÐÈÎÒâµÄÊý¾ÝÀàÐÍ,ͬһ¸öÊý×éµÄ²»Í¬ÔªËØ
¿ÉÒÔ¾ßÓв»Í¬µÄÀàÐÍ,Êý×éµÄÔªËØÉèÖÿÉÒÔ°üº¬ÆäËûÊý×é,ÕâÑù¾Í¿ÉÒÔ´´½¨Ò»¸ö¸´ÔÓµÄÊý×éÁË.
²¢ÇÒÔÚÕâµãÉÏ˵javascript×÷ΪһÖֽű¾ÓïÑÔ²»Í¬ÓÚÄÇÖÖÑϸñµÄÃæÏò¶ÔÏóµÄc++.c#,javaÁË.¾ßÓиü¸ßµÄÁé»îÐÔ.
*/
/*
*ÔÚjavascript1.1ºÍÆäºóµÄ°æ±¾ÖÐ,Êý×éÊÇÓù¹Ô캯ÊýArray()ºÍÔËËã·ûnewÀ´´´½¨,
¿ÉÓÃÒÔϵÄÈýÖÖ·½Ê½À´´´½¨javascript ÖеÄÊý×é.
*/
var a=new Array();
var b=new Array(5,4,3,"first","test,string");
var c=new Array(20);
a[1.23]="test";
document.write("a[1.23]="+a[1.23]);
//ÏàÐÅÿλ´ÓÇ¿ÀàÐ͵ıà³ÌÓïÑÔѧϰjavascriptʱ,¾ø¶Ô»áÒÔΪÉÏÃæÕâÖÖ²Ù×÷¸Ðµ½¾ªÑÈ,
//floatÊý¾ÝÒ²×÷Êý×éµÄϱêÁË,ÊÂʵÉÏ ²¢·ÇÈçÄúËùÏë
//javascriptÔÚÄúÊÇÓøºÊý,¸¡µãÊý,(»ò²¼¶ûÐÍ,¶ÔÏó,ÆäËûֵʱ),javascript»á½«Ëüת»»ÎªÒ»¸ö×Ö·û´®
//ÓÃÉú³ÉµÄ×Ö·û´®×÷Ϊ¶ÔÏóµÄÊôÐÔÃû×Ö,¶ø²»ÊǶ¨ÒåÁËÒ»¸öеÄÊý×éÔªËØ
//ÉÏÃæµÄʵÀýÊÂʵ¾ÍÊÇΪa ´´½¨ÁËÒ»¸öÃûΪ:"1.23"µÄÊôÐÔ.
document.write("a.length="+a.length);
document.write("b.length="+b.length);
document.write("c.length="+c.length);
a[3]="Test";
document.write("<br />a[3]="+a[3]);
document.write("<br/>a.length="+a.length);
//ÒÔÉϲâÊÔÒ²ºÜÃ÷È·ÎÒÃÇÓÃÕûÊý×÷ΪÊý×éµÄϱêÊDzŻáÕæÕýΪÊý×éÌí¼ÓÒ»¸öÔªËØ£¬
//ÕâÀïÓÃÊý×éµÄ³¤¶ÈÀ´ÌåÏÖÁËjavascriptµÄÊý×éÖеİÂÃî¡£
//ͨ¹ýÉèÖÃÊý×éµÄlengthÊôÐÔÄܹý½Ø¶ÏÊý×éµÄ³¤¶È¡£
a.length=3;
if (a[3]==undefined)
{
document.write("<br />ÔÚa.length="+a.length+"ºó£¬a[3]="+a[3]);
}
else
{
document.write("<br />ÔÚa.length="+a.length+"ºó£¬a[3]="+a[3]);
}
//ÕâÀï²âÊÔÎÒÃǵĶàάÊý×éÔªËØ
/*
*javascriptÖÐʵ¼ÊÉÏÊDz»Ö§³Ö¶àάÊý×é
*µ«ÊÇ
Ïà¹ØÎĵµ£º
JavaScriptºÜ³£Ó㬵«Ò²ÒòΪÆä²»¼æÈÝÐÔºÜÁîÈËÍ·ÌÛ¡£Ò»¸öÁíÀàµÄ½â
¾ö·½·¨¾ÍÊÇ£¬½«ÆäËûÓïÑÔ±àÒëΪJavaScript¡£±¾ÎÄÁоÙÁËGWT¡¢Smalltalk¡¢PythonµÈÓïÑÔ½«JavaScript×öΪ±àÒëÄ¿±êµÄÇé
¿ö¡£
¸ã¹ýWeb¿ª·¢µÄ¶¼»ò¶à»òÉÙÃþ¹ýJavaScript£¬¶ø¾¡¹ÜJavascriptÎÞ´¦²»ÔÚ£¬µ«»¹ÊǺÜÄÑÈÃÈËϲ»¶Ëü¡£ÔÚÀàËÆ
Google V8¡¢Apple/WebKitµÄNi ......
1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)> <td>no </table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡Ïûѡȡ¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut=" ......
Êý¾ÝÀàÐÍ
»ù±¾Êý¾ÝÀàÐÍ
»ù±¾Êý¾ÝÀàÐÍÊÇJSÓïÑÔ×îµ×²ãµÄʵÏÖ¡£
¼òµ¥ÊýÖµÀàÐÍ: ÓÐUndefined, Null, Boolean, NumberºÍString¡£×¢Ò⣬ÃèÊöÖеÄÓ¢Îĵ¥´ÊÔÚÕâÀï½öÖ¸Êý¾ÝÀàÐ͵ÄÃû³Æ£¬²¢²»ÌØÖ¸JSµÄÈ«¾Ö¶ÔÏóN an, Boolean, Number, StringµÈ£¬ËüÃÇÔÚ¸ÅÄîÉϵÄÇø±ðÊDZȽϴóµÄ¡£
¶ÔÏó: Ò»¸öÎÞÐòÊôÐԵļ¯ºÏ£¬ÕâЩÊôÐÔµÄֵΪ¼òµ¥ÊýÖµÀ ......
javascriptÄÚ´æÐ¹Â¶µÄÎÊÌâÒ»Ö±ÒÔÀ´¶¼²»Êܵ½´ó¼ÒµÄÖØÊÓ£¬ÔÒòÊǶÔÓû§µÄÓ°ÏìûÓÐ̫ʵ¼ÊµÄ±íÏÖ£¬»òÐí½ü¼¸ÄêÄڴ淢չѸËÙ¡£½Å±¾ÄÚ´æÔÙй¶Ҳ²»»áÓÐÌ«´óÓ°Ïì¡£
µ±È»×÷Ϊǰ¶Ë¿ª·¢µÄͬѧÃÇ£¬¾Í²»ÄÜÓÐÕâÑùµÄ½ÄÐÒÐÄÀí¡£³öÏÖmemory leaksºÜ´ó³Ì¶ÈÉÏÊÇÒòΪ³ÌÐòµÄ²»³ÉÊìºÍ±àÂ벻̫¹æ·¶Ôì³ÉµÄ¡£²»¹ý£¬ÕâÀï¾Í²»ËµÈçºÎ³öÏÖÎÊÌâµÄ£¬¶ÔÎÊÌâ ......