Javascriptѧϰ±Ê¼ÇÒ» ¶ÔÏó
¼ìË÷:
1 ÓÃ||À´Ìî³äĬÈÏÖµ
var status = flight.status || "unknown";
2 ʹÓÃ&&·ÀÖ¹TypeError
flight.equipment.model //throw "TypeError"
flight.equipment && flight.equipment.model //undefined
ÒýÓÃ
var a={},b={},c={};
document.writeln(a===b); //false
ÔÐÍ
JavascriptÌṩµÄʵÏÖ»úÖÆ£º
var stooge = {
"first-name":"Jerome",
"last-name":"Howard"
};
var temp = function(){};
temp.prototype=stooge;
var another_stooge= new temp;
¿ÉÒÔÖ±½Ó¸øObject¼Ó¸ö·½·¨À´¼ò»¯
if (typeof Object.beget !== 'function'){
Object.beget = function (o){
var F = function (){};
F.prototype = o;
return new F();
}
}
var another_stooge =Object.beget(stooge);
another_stooge["first-name"] = 'Harry';
document.writeln(another_stooge["first-name"]); //Harry
document.writeln(another_stooge["last-name"]); //Howard
document.writeln(stooge["first-name"]); //Jerome
·´Éä
typeof¿ÉÒÔ·ÃÎÊÔÐÍÁ´
document.writeln(typeof flight.toString); //function
hasOwnPropertyÔò²»ÐÐ
document.writeln(flight.hasOwnProperty('toString')); //false
ö¾Ù
ʹÓÃfor inö¾ÙÊôÐÔ µÄ˳ÐòÊDz»È·¶¨µÄ£¬¶øÇÒÐèҪʹÓÃhasOwnProperty£¬²¢Ê¹ÓÃtypeofÅųýº¯Êý
×îºÃ
var properties = [
"first-name",
"last-name"
];
for (var i = 0; i < properties.length; i+=1){
document.writeln(properties[i] + ": " + stooge[properties[i]]);
}
ɾ³ý
ɾ³ý²»»á´¥¼°ÔÐÍÁ´£¬É¾³ý¶ÔÏóÊôÐÔ£¬ÔÐÍÁ´µÄÊôÐÔ¸¡ÏÖ³öÀ´
anothet_stooge["first-name"] = "Jack";
document.writeln(anothet_stooge["first-name"]);//Jack
delete anothet_stooge["first-name"];
document.writeln(anothet_stooge["first-name"]);//Jerome
ÃüÃû¿Õ¼ä
var MYAPP= {}£»
MYAPP.stooge = {
//...
};
Ïà¹ØÎĵµ£º
ÄãÖªµÀÊÀ½çÉÏÓжàÉÙÖÖä¯ÀÀÆ÷Â𣿳ýÁËÎÒÃÇÊìÖªµÄIE, Firefox, Opera, SafariËÄ´óä¯ÀÀÆ÷Ö®Í⣬ÊÀ½çÉÏ»¹Óнü°ÙÖÖä¯ÀÀÆ÷¡£
¼¸Ììǰ£¬ä¯ÀÀÆ÷¼Ò×åÓиյ®ÉúÁËһλСÍõ×Ó£¬¾ÍÊÇGoogleÍÆ³öµÄChromeä¯ÀÀÆ÷¡£ÓÉÓÚChrome³öÉúÃûÃÅ£¬¾¡¹ÜËû»¹ÊǸöС¼Ò»ï£¬Ã»ÓÐÈ˸ÒС¿´Ëû¡£ÒÔºó£¬ÔÛÃdz£Ëµä¯ÀÀÆ÷µÄ&ld ......
×ªÔØ×Ô£ºhttp://www.ruanyifeng.com/blog/2009/09/find_element_s_position_using_javascript.html
Áíһƪ£ºhttp://blog.csdn.net/ivan820819/archive/2009/09/03/4515122.aspx
ÖÆ
×÷
ÍøÒ³µÄ¹ý³ÌÖУ¬ÄãÓÐʱºòÐèÒªÖªµÀij¸öÔªËØÔÚÍøÒ³ÉϵÄÈ·ÇÐλÖá£
ÏÂÃæµÄ½Ì³Ì×ܽáÁËJavascriptÔÚÍøÒ³¶¨Î»·½ÃæµÄÏà¹ØÖª
ʶ¡£
Ò»¡¢ÍøÒ³µ ......
ÍêÈ«´ò¿ªÒ³Ãæºó£¬ÔÚ¸ÃÒ³µÄÔÚIEµØÖ·À¸ »ò °´Ctrl+O ÊäÈëÒÔÏ´úÂ룬»Ø³µ£¬¾Í¿ÉÒԵõ½ÏàÓ¦µÄЧ¹û£º
1.ÏÔÊ¾ÍøÒ³ÖеÄËùÓÐͼƬ
javascript:Ai7Mg6P='';for%20(i7M1bQz=0;i7M1bQz<document.images.length;i7M1bQz++){Ai7Mg6P+='<img%20src='+document.images[i7M1bQz].src+'><br>'};if(Ai7Mg6P!=''){document.wri ......
ÔÚÊý¾Ý°ó¶¨Ê¼þÖÐдÈçÏ´úÂ룺
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row .RowType == DataControlRowType .DataRow)//ÅжÏÊÇ·ñΪÊý¾ÝÐÐ
{
//ÔÚµã»÷ɾ³ýʱ£¬µ¯³öÌáʾ¶Ô»°¿ò
LinkButton lb = e.Row.FindControl("LinkB ......
Ô¤¶¨Ê±¼äÖ®ºóÖ´Ðк¯Êý
setTimeout("functionname",interval)
ÌáÈ¡×Ö·û´®ÖÐÊýÖµÐÅÏ¢
parseInt(string)
¸´Öƽڵã(ÊÇ·ñ¸´ÖÆ×Ó½Úµã)
cloneNode(true/false)
ɾ³ý×Ó½Úµã
removeChild()
Ìæ»»½Úµã
replaceChild(newChild,oldChild)
×Ó½ÚµãÅжÏ
hasChildNodes ......