javascript±àдweb×é¼þ£º¶à¼¶²Ëµ¥
ÔÚwebÉϱàд²Ëµ¥Ò»Ö±ÊDZȽÏÍ·ÌÛµÄÊÂÇ飬ҪÊÇÓиöÀàÖ±½ÓÌ×ÓþͺÃÁË£¬×î½üÓÖÒª×öÍøÕ¾ÁË£¬·³ÈË£¬ÒªÇó×öµÄ»¹ÊǶ༶²Ëµ¥£¬°¦£¬·Ï»°ÉÙ˵£¬Óöµ½ÎÊÌâ¾ÍÒª½â¾ö°¡£¬¿´´úÂ룺
function is(e, handler) {
if (e.type != 'mouseout' && e.type != 'mouseover') return false;
var reltg = e.relatedTarget ? e.relatedTarget : e.type == 'mouseout' ? e.toElement : e.fromElement;
while (reltg && reltg != handler)
reltg = reltg.parentNode;
return (reltg != handler);
}
var menu=function(obj){
var div=document.createElement("div");
div.style.position="absolute";
div.style.left="-1000px";
div.style.top="0px";
div.flag="menu"
document.body.appendChild(div);
div.onmouseout=function(e){
var e=e||window.event;
if(!is(e,this)) return;
e=e.relatedTarget?e.relatedTarget:e.toElement;
if(e.flag!="menu"){
div.style.left="-1000px";
div.style.top="0px"
}
}
function exec(obj,div){
var a;
for(a in obj){
var item=document.createElement("div");
item.flag="menu";
item.style.textAlign="center";
item.in
Ïà¹ØÎĵµ£º
JavascriptË¢ÐÂÒ³ÃæµÄ¼¸ÖÖ·½·¨£º
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7& ......
Óï·¨
oNewWindow = window.open( [sURL] [, sName] [, sFeatures] )
sURL ¿ÉÑ¡. URL ×Ö·û´® . Èç¹ûURLΪ¿Õ, ½«ÒÔabout:blank´ò¿ª.
sName ¿ÉÑ¡. ×Ö·û´® ÃèÊö´ò¿ª´°¿ÚµÄÃû×Ö(name). ¿ÉÒÔ×öΪform ºÍ a ±êÇ©µÄTARGETÊôÐÔÖµ .
sFeatures ¿ÉÑ¡. ×Ö·û´® ¸ñʽÈç"fullscreen=yes,toolbar=yes".channelmode = { yes | no | ......
·µ»Ø JavaScript È«¾Ö¶ÔÏó²Î¿¼ÊÖ²á
¶¨ÒåºÍÓ÷¨
isNaN() º¯ÊýÓÃÓÚ¼ì²éÆä²ÎÊýÊÇ·ñÊÇ·ÇÊý×ÖÖµ¡£
Óï·¨
isNaN(x)
²ÎÊýÃèÊö
x
±ØÐè¡£Òª¼ì²âµÄÖµ¡£
·µ»ØÖµ
Èç¹û x ÊÇÌØÊâµÄ·ÇÊý×ÖÖµ NaN£¨»òÕßÄܱ»×ª»»ÎªÕâÑùµÄÖµ£©£¬·µ»ØµÄÖµ¾ÍÊÇ true¡£Èç¹û x ÊÇÆäËûÖµ,Ôò·µ»Ø false¡£
˵Ã÷
isNaN() º¯Êý¿ÉÓÃÓÚÅжÏÆä²ÎÊýÊÇ·ñÊÇ NaN£ ......
Ê×ÏÈ¿´demo´úÂ룺
var student={
name:"leo",
intro:function(){
alert("my name is "+this.name);
}
}
var teacher=function(f){
f();
}
teacher(student.intro);
ÔÚÉÏÃæµÄdemo£¬¿ÉÒÔ¿´µ½ÏÔʽµÄ¶¨ÒåÁËÒ»¸ö¶ÔÏóstudent£¬ÓÐÒ»¸ö³ÉÔ±º¯ÊýintroºÍÒ»¸ö³ÉÔ±±äÁ¿¡£
ÁíÍⶨÒåÁËÒ»¸öº¯Êýteacher£¬½ÓÊ ......