javascript evalµÄ¼òµ¥Ó÷¨
js eval
evalº¯Êý½ÓÊÕÒ»¸ö²ÎÊýs£¬Èç¹ûs²»ÊÇ×Ö·û´®£¬ÔòÖ±½Ó·µ»Øs¡£·ñÔòÖ´ÐÐsÓï¾ä¡£Èç¹ûsÓï¾äÖ´Ðнá¹ûÊÇÒ»¸öÖµ£¬Ôò·µ»Ø´ËÖµ£¬·ñÔò·µ»Øundefined¡£
Àý×Ó
Ö±½ÓÔËËã
alert(eval('1+2')); // ->3
¸³Öµ
eval('var aa = 5');
alert(aa); // ->5
ÀàÐÍת»»
var yy = "{a:'aa',b:'bb'}";
yy = eval('(' + yy + ')');
alert(yy);
ÐèÒªÌرð×¢ÒâµÄÊǶÔÏóÉùÃ÷Óï·¨“{}”²¢²»ÄÜ·µ»ØÒ»¸öÖµ£¬ÐèÒªÓÃÀ¨ºÅÀ¨ÆðÀ´²Å»á·µ»ØÖµ;
¶ÔÓÚ¶ÔÏóÉùÃ÷Óï¾äÀ´Ëµ£¬½ö½öÊÇÖ´ÐУ¬²¢²»ÄÜ·µ»ØÖµ¡£ÎªÁË·µ»Ø³£Óõē{}”ÕâÑùµÄ¶ÔÏóÉùÃ÷Óï¾ä£¬±ØÐëÓÃÀ¨ºÅÀ¨×¡£¬ÒÔ½«Æäת»»Îª±í´ïʽ£¬²ÅÄÜ·µ»ØÆäÖµ¡£ÕâÒ²ÊÇʹÓÃJSONÀ´½øÐÐAjax¿ª·¢µÄ»ù±¾ÔÀíÖ®Ò»¡£
×îºó»¹Òª¿¼ÂÇ×÷Ó÷¶Î§µÄÎÊÌ⣬¿ÉÒԲο¼ÒÔÏÂÍøÕ¾
http://wanyij.blog.51cto.com/46570/43794
Ïà¹ØÎĵµ£º
// ѧϰҪÏ뿽±´ÄÇô¿ì¾ÍºÃÁË
//
// JavaScript µÄ¼Ì³ÐÊÇ»ùÓÚ prototype µÄ£¬Ã¿¸ö¶ÔÏóµÄ prototype ÊDZ£´æÔÚ¶ÔÏóµÄ __proto__ ÊôÐÔÖеģ¬Õâ¸öÊôÐÔÊÇÄÚ²¿(internal)µÄÊôÐÔ( ¹ßÀýÊÇÄÚ²¿µÄ»òÕßÒþ²ØµÄÊôÐÔÒÔ _ ¿ªÍ·)
// A prototype-based language has the notion of a prototypical object, an object used as a template ......
JavaScript For Ñ»·
Previous Page
Next Page
JavaScript ÖеÄÑ»·ÓÃÀ´½«Í¬Ò»¶Î´úÂëÖ´ÐÐÖ¸¶¨µÄ´ÎÊý£¨»òÕßµ±Ö¸¶¨µÄÌõ¼þΪ true ʱ£©¡£
ʵÀý
For Ñ»· ÈçºÎ±àд loop Ñ»·À´°´ÕÕÖ¸¶¨µÄ´ÎÊýÖ´ÐÐÏàͬµÄ´úÂë¡£ Ñ»·²úÉú HTML ±êÌâ ÈçºÎʹÓÃLoopÑ»·À´²úÉú²»Í¬µÄHTML±êÌâ¡£
JavaScript Ñ»·
ÔÚ±àд´úÂëʱ£¬Äã³£³£Ï£Íû· ......
//¹ýÂËÁ½¶ËµÄ¿Õ¸ñ
function trim(str){
return str.replace(/(^\s*)|(\s*$)/g, "");
}
//¹ýÂË×ó±ßµÄ¿Õ¸ñ
function ltrim(str){
return  ......
with(document)
{
write ("test");
write
("dsasfda");
}
ÉÏÃæÊÇÓÃÁËwith
Èç¹û²»ÓõĻ°¾ÍÒªÕâÑùдÁË
document.write (" ......
.netÖÐǰ̨javascriptÓëºǫ́c#Ï໥µ÷ÓÃ
¡¡¡¡C#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃ
¡¡¡¡ÎÊ£º
¡¡¡¡1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
¡¡¡¡2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
¡¡¡¡3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
¡¡¡¡4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
¡¡¡¡ÎÊÌâ1´ð°¸ÈçÏ£º
¡¡¡¡javaScriptº¯ÊýÖÐÖ´ÐÐC# ......