javascript withÓ÷¨(ת)
with
(object)
statements
²ÎÊý
object
еÄĬÈ϶ÔÏó¡£
statements
Ò»¸ö»ò¶à¸öÓï¾ä£¬object ÊǸÃÓï¾äµÄĬÈ϶ÔÏó¡£
˵Ã÷
with
Óï¾äͨ³£ÓÃÀ´Ëõ¶ÌÌض¨ÇéÐÎϱØÐëдµÄ´úÂëÁ¿¡£ÔÚÏÂÃæµÄÀý×ÓÖУ¬Çë×¢Òâ Math µÄÖظ´Ê¹Óãº
x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10)
y = Math.tan(14 * Math.E)
µ±Ê¹Óà with
Óï¾äʱ£¬´úÂë±äµÃ¸ü¶ÌÇÒ¸üÒ׶Á£º
with
(Math){
x = cos(3 * PI) + sin (LN10)
y = tan(14 * E)
}
Ïà¹ØÎĵµ£º
ä¯ÀÀÆ÷£ºIE 8¡¢FF 3.6¡¢Chrome 4.0¡¢Safari 4.0¡¢Opera 10.1
½öÓÐIEä¯ÀÀÆ÷Ö§³ÖHTMLElement.onresize£¨±ÈÈçbody.onresize£©
ÆäËüä¯ÀÀÆ÷Ö»Ö§³Öwindow.onresize
ÏÈ˵IEµÄHTMLElement.onresize
ʹÓÃÇ°ÇëÈ·¶¨ÄãµÄÐÄÔ༰ѪѹÕý³££¬Èç¹ûÄ㶨ÒåÁË
body.onresize = function(){……}»òÕßhtml.onresize = obj.fun;
......
ÔÚÒ»¸öÍøÒ³Öеİ´Å¥£¬Ð´onclickʼþµÄ´¦Àí´úÂ룬²»Ð¡ÐÄд³ÉÈçÏ£º
<input value="Test" type="button" onclick="alert(""OK"");" />
IEÌáʾ³ö´íºó£¬ÔÙÂþ²»¾ÐĵظÄΪ£º
<input value="Test" type="button" onclick="alert(\"OK\");" />
½á¹û»¹Êdzö´í¡£
Õâʱ£¬ÎÒ¾ÍÏ벻ͨÁË£¬ËäÈ»ÎÒÖªµÀ×îÖ±½ÓµÄ½â¾ö·½·¨ ......
Ïȸø³ö»ù±¾µÄHTMLÎļþ£º
<ul>
<li id="m01"></li>
<li id="m01"></li>
<li id="m01"></li>
</ul>
<div>
<div id="C01"> </div>
<div id="C02">&n ......
±¾ÎĽéÉÜjavascriptÁ¬½ÓaccessÊý¾Ý¿âµÄ·½·¨¡£Õâ¶Î´úÂëÔÚ±¾µØ¿ÉÒÔÕý³£ÔËÐУ¬ÔÚÏßÔòÐèÒª×ã¹»µÄȨÏÞ¡£ÓÉÓÚ²ÉÓÃAccessÊý¾Ý¿â£¬ËùÒÔ²¢²»Ê¹Óñê×¼µÄSQLÓ﷨ʹÓÃʱ¡£ÐèҪעÒâ¡£
Õ⼸Ìì·ÑÁËͦ´óÁ¦ÆøÔÚÍøÉϲéÕÒjavascriptÁ¬½ÓaccessÊý¾Ý¿âµÄ·½·¨£¬¾¹ýÕûÀí×ܽᣬÖÕÓÚд³öÒ»¶ÎÄܹ»ÓÐЧִÐеĴúÂë¡£
µ«ÊÇÕâ¶Î´úÂëÔÚ±¾µØ¿ÉÒÔÕý³£ÔËÐУ ......
<html>
<head><title>js¿ÉÒƶ¯´°¿ÚµÄÉè¼Æ</title>
<script language="javascript">
var x0=0,y0=0,x1=0,y1=0;//³õʼ»¯È«¾Ö±äÁ¿
var offx=6,offy=6;
var moveable=false;
var hover='orange';//color;
var index=10000;//z-index;
//¹Ø±Õ´°¿Ú
function closeWin(id)
{& ......