?? script.html
字號(hào):
<html>
<head>
<title>script - HTML元素參考-HTML Elements Reference-網(wǎng)頁(yè)教程與代碼的中文站點(diǎn)-布啦布啦-blabla.cn</title>
<meta name="author" content="www.blabla.cn">
<meta name="keywords" content="script,HTML參考,HTML教程, HTML代碼,HTML元素,HTML elements,網(wǎng)頁(yè)教程和代碼的中文網(wǎng)站,網(wǎng)頁(yè)制作,源代碼,示例,布啦布拉,blabla.cn,examples">
<meta name="description" content="-網(wǎng)頁(yè)教程與代碼的中文站點(diǎn)-網(wǎng)頁(yè)制作-布啦布啦-blabla.cn">
<meta name="generator" content="blabla buildsite v2.0 - C:\CodeBank\BLABLA\blablasource\webtutorials\150_html_ref\100_html_elements\415_script.txt">
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../styles/bla01.css" type="text/css">
<script type="text/javascript">
function WsFvt() {
window.external.addFavorite(
"../default.htm",
"布啦布啦網(wǎng)頁(yè)教程與代碼[www.blabla.cn]");
}
function WsHome() {
event.srcElement.style.behavior = "url(#default#homepage)";
event.srcElement.setHomePage("../default.htm");
}
function WsActOn() {
event.srcElement.className = "wsacton";
}
function WsAct() {
event.srcElement.className = "wsact";
}
</script>
</head>
<body class=wsbody>
<div class=wsheader>
<table cellpadding=0 cellspacing=0 class=wslogoarea>
<td class=ws_a1><img src="../images/logo/blabla_logo01.gif" class=blablalogo03></td>
<td class=ws_a2>
<div>
<font class=wsact onmouseover="WsActOn()" onmouseout="WsAct()" onclick="WsFvt()">加入收藏</font> |
<font class=wsact onmouseover="WsActOn()" onmouseout="WsAct()" onclick="WsHome()">設(shè)為首頁(yè)</font>|
<a href="mailto:webmaster@blabla.cn">聯(lián)系我們</a>
</div>
<div style = "height:20px;"></div>
<div>
<a href="../html_tutorials/index.html">HTML教程</a> |
<a href="../html_tutorials/100_html_examples.html">HTML示例代碼</a> |
<a href="../css_tutorials/index.html">CSS教程</a> |
<a href="../css_tutorials/100_CSS_examples.html">CSS示例代碼</a> |
<a href="../js_tutorials/index.html">Javascript教程</a> |
<a href="../js_tutorials/100_js_examples.html">Javascript示例代碼</a>
</div>
</td>
</tr></table>
</div>
<div class=wscontent>
<table cellpadding=0 cellspacing=0 class=wscgrid>
<td class=a1>
<div class=wsmenu><div class=box><div class=box>
<!--menupart Start -->
<a href = "../index.html"><H1>網(wǎng)站首頁(yè)</H1></a>
<a href = "index.html" ><H1>HTML元素參考</H1></a><a href = "../html_attr_ref/index.html" ><H1>HTML屬性參考</H1></a>
<!--menupart end -->
</div></div></div>
</td>
<td class=a2><div class=wsarticle><div class=articlepart id = ap>
<div class=wstitle><div class=box><div class=box><h1>HTML元素 - script</h1></div></div></div>
<!--articlepart start-->
<div class = changefont>
<span onclick= "ap.className='ArticlePartBig';" class = bfont>大字體</span>
<span onclick= "ap.className='ArticlePart';" class = sfont>小字體</span>
</div>
<H2>定義</H2><P>指定由腳本引擎解釋的頁(yè)面中的腳本。</P><P>Specifies a script for the page that is interpreted by a script engine.</P><H2>注釋</H2><P>SCRIPT 塊內(nèi)的代碼如果不包含在函數(shù)內(nèi),那么將會(huì)在頁(yè)面載入時(shí)立即執(zhí)行。要保證腳本不在較低版本的瀏覽器中顯示,應(yīng)該將 SCRIPT 塊嵌套在 COMMENT 塊內(nèi)。</P><P>FRAMESET 元素后出現(xiàn)的腳本將被忽略。</P><P>此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的腳本中可用。</P><P>只要沒(méi)有在 SCRIPT 對(duì)象中定義 language 屬性,MSHTML 就會(huì)嘗試使用恰當(dāng)?shù)哪_本引擎。如果選擇了錯(cuò)誤的腳本引擎,那么通常會(huì)產(chǎn)生錯(cuò)誤。如果在一個(gè)頁(yè)面中使用了多個(gè) SCRIPT 對(duì)象,則可能需要為每個(gè) SCRIPT 對(duì)象指定 language 屬性,而且推薦這么做。一個(gè)文檔中 SCRIPT 對(duì)象的順序也很重要,特別是為文檔中一個(gè)或多個(gè)元素指定的腳本事件句柄。擴(kuò)展標(biāo)記語(yǔ)言(XML)是 SCRIPT 對(duì)象的合法內(nèi)容,但 XML 并不是一種腳本語(yǔ)言。因此,如果 MSHTML 把包含事件句柄函數(shù)的 SCRIPT 對(duì)象看作了 XML 數(shù)據(jù)島,將會(huì)發(fā)生錯(cuò)誤。之所以會(huì)產(chǎn)生這樣的結(jié)果,是因?yàn)?MSHTML 會(huì)將第一個(gè)有 language 屬性的 SCRIPT 對(duì)象作為事件句柄的默認(rèn)引擎塊。有關(guān)更多信息,請(qǐng)參看示例。</P><P>此元素不顯示。</P><P>此元素需要關(guān)閉標(biāo)簽。</P><P>Code within the SCRIPT block that is not contained within a function is executed immediately as the page is loaded. To keep scripts from being displayed on down-level browsers, nest the SCRIPT block within a COMMENT block.</P><P>Script appearing after a FRAMESET element is ignored.</P><P>This element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0.</P><P>Whenever the language attribute is not defined on the SCRIPT object, then MSHTML attempts to select a suitable scripting engine. An error generally occurs if the wrong scripting engine is selected. When more than one SCRIPT object is used on a page, it can be necessary to specify the language attribute for each SCRIPT object, and doing so is always recommended. The order of the SCRIPT objects in a document can also be important, especially if scripting event handlers are assigned to one or more elements in the document. Extensible Markup Language (XML) is legitimate content for the SCRIPT object, but XML is not a scripting language. Therefore, an error can occur if MSHTML selects an XML data island as the SCRIPT object that contains an event handler function. This can happen because MSHTML selects the first SCRIPT object that has the language attribute defined as the default script block for event handlers. For more information, see the examples.</P><P>This element is not rendered.</P><P>This element requires a closing tag.</P><H2>示例代碼</H2><P>The following code snippet provides a scenario where an error occurs.</P><P>下面的代碼段提供了發(fā)生錯(cuò)誤的典型例子。</P><PRE><html></PRE><PRE><head></PRE><PRE><SCRIPT LANGUAGE="XML" id="mySrc1"></PRE><PRE><offerings></PRE><PRE> <class><materials>This should render.</materials><time>1.5</PRE><PRE>hr</time></class></PRE><PRE></offerings></PRE><PRE></SCRIPT></PRE><PRE><SCRIPT LANGUAGE="Javascript"></PRE><PRE>function returnIslandRootName()</PRE><PRE>{</PRE><PRE> var islandRoot = document.all["mySrc1"].XMLDocument;</PRE><PRE> alert(islandRoot.nodeName);</PRE><PRE>}</PRE><PRE></SCRIPT></PRE><PRE></head></PRE><PRE><body></PRE><PRE><button onclick="returnIslandRootName()">Test the XML Data Island</button></PRE><PRE></body></PRE><PRE></html></PRE><P> </P><P>由于 XML 數(shù)據(jù)島是定義了 langauge 屬性的第一個(gè) SCRIPT 對(duì)象,MSHTML 會(huì)嘗試將 returnIslandRootName 函數(shù)以 XML 裝入,這當(dāng)然會(huì)導(dǎo)致失敗。要修正這個(gè)例子,只需要更改 SCRIPT 對(duì)象的順序,如下所示:</P><P>Because the XML data island is the first instance of the SCRIPT object that has the language attribute defined, MSHTML attempts to locate the returnIslandRootName function in the XML and fails. To correct the sample, the order of the SCRIPT objects can changed, as shown by the following:</P><PRE><html></PRE><PRE><head></PRE><PRE><SCRIPT LANGUAGE="Javascript"></PRE><PRE>function returnIslandRootName()</PRE><PRE>{</PRE><PRE> var islandRoot = document.all["mySrc1"].XMLDocument;</PRE><PRE> alert(islandRoot.nodeName);</PRE><PRE>}</PRE><PRE></SCRIPT></PRE><PRE><SCRIPT LANGUAGE="XML" id="mySrc1"></PRE><PRE><offerings></PRE><PRE> <class><materials>This should render.</materials><time>1.5</PRE><PRE>hr</time></class></PRE><PRE></offerings></PRE><PRE></SCRIPT></PRE><PRE></head></PRE><PRE><body></PRE><PRE><button onclick="returnIslandRootName()">Test the XML Data Island</button></PRE><PRE></body></PRE><PRE></html></PRE><P> </P><P> </P>
<!--articlepart end-->
</div><div></td>
<td class=a3><div class=wslink>
<div class=wsportrait>
<img src="../images/logo/blabla_logo02.gif" class=blablalogo21>
</div>
<div class=wslgreen><div class=box><div class=box>
<h2>布啦布啦旗下網(wǎng)站</h2>
<p><a href="../index.html">布啦布啦網(wǎng)頁(yè)教程與代碼</a></p>
<p><a href="http://www.wowstory.com">小斧的魔獸世界</a></p>
<p><a href="../wow/index.html">小斧的魔獸世界鏡像</a></p>
<p><a href="http://hardware.blabla.cn">數(shù)碼資訊</a></p>
</div></div></div>
<div style= "background-color:#FFFFF0;
border-top:3px solid #FFCC66; border-bottom:3px solid #FFCC66;border-left:1px solid #FFE0A1;border-right:1px solid #FFE0A1;">
<!-- SiteSearch Google -->
<form method="get" action="http://www.google.com/custom" target="_top">
<table border="0" bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
</td>
<td nowrap="nowrap">
<input type="hidden" name="domains" value="blabla.cn"></input>
<input type="text" name="q" size="18" maxlength="255" value=""></input>
</td></tr>
<tr>
<td> </td>
<td nowrap="nowrap">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value=""></input>
<font size="-1" color="#000000" style = "font-size:12px;">Web</font>
</td>
<td>
<input type="radio" name="sitesearch" value="blabla.cn" checked="checked"></input>
<font size="-1" color="#000000" style = "font-size:12px;">blabla.cn</font>
</td>
</tr>
</table>
<input type="submit" name="sa" value="Google 搜索"></input>
<input type="hidden" name="client" value="pub-3105632846497229"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="GB2312"></input>
<input type="hidden" name="oe" value="GB2312"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="zh-CN"></input>
</td></tr></table>
</form>
<!-- SiteSearch Google -->
</div>
<div style ="height:8px;font-size:8px;"></div>
<!--Google Adsense start-->
<div id="googlead" style = "width:160px; height:600px;" ></div>
<!--Google Adsense end-->
</div>
</td></tr>
</table></div>
<div class=wsfooter>
<table cellpadding=0 cellspacing=0 class=wsgrid>
<tr><td class=ws_a1>
<!--footer label start-->
© 2005 blabla.cn版權(quán)所有
<!--51yes statistics start-->
<script language="javascript" src="http://count1.51yes.com/click.aspx?id=13420718&logo=12"></script>
<!--51yes statistics end-->
</td></tr></table>
</div>
<!--Google Ad Script Start -->
<div id="googleadcode" style="display:none;">
<script type="text/javascript"><!--
google_ad_client = "pub-3105632846497229";
google_alternate_color = "FFFFFF";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "A8C8FF";
google_color_bg = "F5F9FF";
google_color_link = "0058DB";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<script language="javascript">
if(document.all.item("googlead") != null)
{
googlead.innerHTML = googleadcode.innerHTML;
}
</script>
<!--Google Ad Script End-->
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -