学习时曾经用到的资料

源代码在线查看: script.html

软件大小: 2093 K
上传用户: wilsonshaw
关键词:
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				script - HTML元素参考-HTML Elements Reference-网页教程与代码的中文站点-布啦布啦-blabla.cn
				
				
				
				
				
				
				
				
				function WsFvt() {
				    window.external.addFavorite(
				        "../default.htm", 
				        "布啦布啦网页教程与代码[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";
				}
				
				
				
				
				
				
				
				
				
				
				加入收藏 |
				设为首页|
				联系我们
				
				
				
				HTML教程 |
				HTML示例代码 |
				CSS教程 |
				CSS示例代码 |
				Javascript教程 |
				Javascript示例代码
				
				
				
				
				
				
				
				
				
				
				网站首页
				HTML元素参考HTML属性参考
				
				
				
				
				HTML元素 - script
				
				
				大字体
				小字体
				
				定义指定由脚本引擎解释的页面中的脚本。Specifies a script for the page that is interpreted by a script engine.注释SCRIPT 块内的代码如果不包含在函数内,那么将会在页面载入时立即执行。要保证脚本不在较低版本的浏览器中显示,应该将 SCRIPT 块嵌套在 COMMENT 块内。FRAMESET 元素后出现的脚本将被忽略。此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的脚本中可用。只要没有在 SCRIPT 对象中定义 language 属性,MSHTML 就会尝试使用恰当的脚本引擎。如果选择了错误的脚本引擎,那么通常会产生错误。如果在一个页面中使用了多个 SCRIPT 对象,则可能需要为每个 SCRIPT 对象指定 language 属性,而且推荐这么做。一个文档中 SCRIPT 对象的顺序也很重要,特别是为文档中一个或多个元素指定的脚本事件句柄。扩展标记语言(XML)是 SCRIPT 对象的合法内容,但 XML 并不是一种脚本语言。因此,如果 MSHTML 把包含事件句柄函数的 SCRIPT 对象看作了 XML 数据岛,将会发生错误。之所以会产生这样的结果,是因为 MSHTML 会将第一个有 language 属性的 SCRIPT 对象作为事件句柄的默认引擎块。有关更多信息,请参看示例。此元素不显示。此元素需要关闭标签。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.Script appearing after a FRAMESET element is ignored.This element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0.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.This element is not rendered.This element requires a closing tag.示例代码The following code snippet provides a scenario where an error occurs.下面的代码段提供了发生错误的典型例子。<html><head><SCRIPT LANGUAGE="XML" id="mySrc1"><offerings> <class><materials>This should render.</materials><time>1.5hr</time></class></offerings></SCRIPT><SCRIPT LANGUAGE="Javascript">function returnIslandRootName(){  var islandRoot = document.all["mySrc1"].XMLDocument;  alert(islandRoot.nodeName);}</SCRIPT></head><body><button onclick="returnIslandRootName()">Test the XML Data Island</button></body></html> 由于 XML 数据岛是定义了 langauge 属性的第一个 SCRIPT 对象,MSHTML 会尝试将 returnIslandRootName 函数以 XML 装入,这当然会导致失败。要修正这个例子,只需要更改 SCRIPT 对象的顺序,如下所示: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:<html><head><SCRIPT LANGUAGE="Javascript">function returnIslandRootName(){  var islandRoot = document.all["mySrc1"].XMLDocument;  alert(islandRoot.nodeName);}</SCRIPT><SCRIPT LANGUAGE="XML" id="mySrc1"><offerings> <class><materials>This should render.</materials><time>1.5hr</time></class></offerings></SCRIPT></head><body><button onclick="returnIslandRootName()">Test the XML Data Island</button></body></html>  
				
				
				
				
				
				
				
				
				
				
				布啦布啦旗下网站
				布啦布啦网页教程与代码
				小斧的魔兽世界
				小斧的魔兽世界镜像
				数码资讯
				
				
				
								    border-top:3px solid #FFCC66; border-bottom:3px solid #FFCC66;border-left:1px solid #FFE0A1;border-right:1px solid #FFE0A1;">
				
				
				
				
				
				
				
				
				
				
				
				 
				
				
				
				
				
				Web
				
				
				
				blabla.cn
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				© 2005 blabla.cn版权所有  
				
				
				
				
				
				
				
				
				
								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";
				//-->
								  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
				
				
				
				
				if(document.all.item("googlead") != null)
				{
				  googlead.innerHTML = googleadcode.innerHTML;
				}
				
				
				
				
							

相关资源