200以上のjsテクニックコード(7)
12028 ワード
179.【 (F)】
1、〖 〗
[ ]:document.execCommand("open")
[ ] VB webbrowser , 。
[ ] <body></body> :
<a href="###" onclick=document.execCommand("open")> </a>
2、〖 〗
[ ]:location.replace("view-source:"+location)
[ ] , 。
[ ] <body></body> :
<a href="###" onclick=location.replace("view-source:"+location)> </a>
3、〖 〗
[ ]:document.execCommand("saveAs")
[ ] !
[ ] <body></body> :
<a href="###" onclick=document.execCommand("saveAs")> </a>
4、〖 〗
[ ]:document.execCommand("print")
[ ] , !
[ ] <body></body> :
<a href="###" onclick=document.execCommand("print")> </a>
5、〖 〗
[ ]:window.close();return false
[ ] 。
[ ] <body></body> :
<a href="###" onclick=window.close();return false)> </a>
180.【 (E)】
〖 〗
[ ]:document.execCommand("selectAll")
[ ] !
[ ] <body></body> :
<a href="###" onclick=document.execCommand("selectAll")> </a>
181.【 (V)】
1、〖 〗
[ ]:location.reload() history.go(0)
[ ] 。
[ ] <body></body> :
<a href="###" onclick=location.reload()> </a>
:
<a href="###" onclick=history.go(0)> </a>
2、〖 〗
[ ]:location.replace("view-source:"+location)
[ ] 。
[ ] <body></body> :
<a href="###" onclick=location.replace("view-source:"+location)> </a>
3、〖 〗
[ ]:window.open(document.location, "url", "fullscreen")
[ ] 。
[ ] <body></body> :
<a href="###" onclick=window.open(document.location,"url","fullscreen")> </a>
182.【 (A)】
1、〖 〗
[ ]:window.external.AddFavorite('url', '“ ”)
[ ] 。
[ ] <body></body> :
<a href="javascript:window.external.AddFavorite('http://oh.jilinfarm.com', ' ')">
</a>
2、〖 〗
[ ]:window.external.showBrowserUI("OrganizeFavorites",null)
[ ] 。
[ ] <body></body> :
<a href="###" onclick=window.external.showBrowserUI("OrganizeFavorites",null)> </a>
183.【 (T)】
〖internet 〗
[ ]:window.external.showBrowserUI("PrivacySettings",null)
[ ] internet 。
[ ] <body></body> :
<a href="###" onclick=window.external.showBrowserUI("PrivacySettings",null)>internet </a>
184.【 】
1、〖 〗
[ ]history.go(1) history.forward()
[ ] 。
[ ] <body></body> :
<a href="###" onclick=history.go(1)> </a>
:
<a href="###" onclick=history.forward()> </a>
2、〖 〗
[ ]:history.go(-1) history.back()
[ ] 。
[ ] <body></body> :
<a href="###" onclick=history.go(-1)> </a>
:
<a href="###" onclick=history.back()> </a>
3、〖 〗
[ ]:document.reload() history.go(0)
[ ] 。
[ ] <body></body> :
<a href="###" onclick=location.reload()> </a>
:
<a href="###" onclick=history.go(0)> </a>
185.
〖 〗
[ ]:settimeout(window.close(), )
[ ] 。
[ ] <body></body> :
<a href="###" onclick=settimeout(window.close(),3000)>3 </a>
【 】 , , html , 。
<a href="###" onclick=document.execCommand("open")> </a>
<a href="###" onclick=location.replace("view-source:"+location)> </a>
<a href="###" onclick=document.execCommand("saveAs")> </a>
<a href="###" onclick=document.execCommand("print")> </a>
<a href="###" onclick=window.close();return false)> </a>
<a href="###" onclick=document.execCommand("selectAll")> </a>
<a href="###" onclick=location.reload()> </a> <a href="###" onclick=history.go(0)> </a>
<a href="###" onclick=location.replace("view-source:"+location)> </a>
<a href="###" onclick=window.open(document.location,"url","fullscreen")> </a>
<a href="javascript:window.external.AddFavorite('http://homepage.yesky.com', ' ')">
</a>
<a href="###" onclick=window.external.showBrowserUI("OrganizeFavorites",null)> </a>
<a href="###" onclick=window.external.showBrowserUI("PrivacySettings",null)>internet </a>
<a href="###" onclick=history.go(1)> 1</a> <a href="###" onclick=history.forward()> 2</a>
<a href="###" onclick=history.go(-1)> 1</a> <a href="###" onclick=history.back()> 2</a>
<a href="###" onclick=settimeout(window.close(),3000)>3 </a>
186. DHTML ,
<BODY onload="alert(a1.epass)">
<input type=text name="a1" epass="zhongguo">
</BODY>//
187.xmlhttp
<BODY> XMLHTTP XML , 。
<input type=button value=" XML " onclick="getData('data.xml')" >
<script language="JavaScript" >
function getDatal(url){
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");// XMLHTTPRequest
xmlhttp.open("GET",url,false,"","");// HTTP GET HTTP
xmlhttp.send("");// HTTP HTTP
return xmlhttp.responseXML;// XML
}
</script >
</BODY>//
188. request.getReader()
189. java
java.util.regex.Pattern p =
java.util.regex.Pattern.compile("\\d+|.\\d+|\\d+.\\d*|(E|\\d+E|.\\d+E|\\d+.\\d*E)((\\+|-)\\d|\\d)\\d*");
java.util.regex.Matcher m = p.matcher("12.E+3");
boolean result = m.matches();//
190.
<SELECT>
<OPTGROUP LABEL=" ">
<OPTION> (Li)</OPTION>
<OPTION> (Na)</OPTION>
<OPTION> (K)</OPTION>
</OPTGROUP>
<OPTGROUP LABEL=" ">
<OPTION> (F)</OPTION>
<OPTION> (Cl)</OPTION>
<OPTION> (Br)</OPTION>
</OPTGROUP>
</SELECT>//
191.
<RUBY>
<RT>
</RUBY>//
192.
<S> 。</S>//
193. frame event
document.frames("workspace").event.keyCode//
194.
String.prototype.trim=function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
alert(" ".trim)//
195.
if (window != window.top)
top.location.href = location.href;//
196. frame
if(window==window.top)
{
document.body.innerHTML="<center><h1> !</h1></center>";
//window.close();
}//
197.
<SCRIPT>
function fnSet(){
oHomePage.setHomePage(location.href);
event.returnValue = false;
}
</SCRIPT>
<IE:HOMEPAGE ID="oHomePage" style="behavior:url(#default#homepage)"/>//
198.xml
<HTML>
<HEAD><Title>HTML </Title></HEAD>
<body bkcolor=#EEEEEE text=blue bgcolor="#00FFFF">
<Table align=center width="100%"><TR><TD align="center">
<h5><b><font size="4" color="#FF0000">HTML XML </font></b></h5>
</TD></TR></Table>
<HR>
:<input type=text datasrc=#theXMLisland DataFLD=NAME size="76">
:<input type=text datasrc=#theXMLisland DataFLD=Address size="76">
:<input type=text datasrc=#theXMLisland DataFLD=HomePage size="76">
:<input type=text datasrc=#theXMLisland DataFLD=E-Mail size="76">
:<input type=text datasrc=#theXMLisland DataFLD=TelePhone size="76">
:<input type=text datasrc=#theXMLisland DataFLD=Grade size="76"><HR>
<input id="first" TYPE=button value="<< " onclick="theXMLisland.recordset.moveFirst()">
<input id="prev" TYPE=button value="< " onclick="theXMLisland.recordset.movePrevious()">
<input id="next" TYPE=button value=" >" onclick="theXMLisland.recordset.moveNext()">
<input id="last" TYPE=button value=" >>" onclick="theXMLisland.recordset.moveLast()">
<input id="Add" TYPE=button value=" " onclick="theXMLisland.recordset.addNew()">
<XML ID="theXMLisland">
<HotelList>
<Hotel>
<Name> </Name>
<Address> 1 </Address>
<HomePage>www.sihaohotel.com.cn</HomePage>
<E-Mail>[email protected]</E-Mail>
<TelePhone>(0989)8888888</TelePhone>
<Grade> </Grade>
</Hotel>
<Hotel>
<Name> </Name>
<Address> 99 </Address>
<HomePage>www.wuhu.com.cn</HomePage>
<E-Mail>[email protected]</E-Mail>
<TelePhone>(0979)1111666</TelePhone>
<Grade> </Grade>
</Hotel>
<Hotel>
<Name>“ ” </Name>
<Address> 168 </Address>
<HomePage>www.dashamohotel.com.cn</HomePage>
<E-Mail>[email protected]</E-Mail>
<TelePhone>(0989)87878788</TelePhone>
<Grade> </Grade>
</Hotel>
<Hotel>
<Name>“ ” </Name>
<Address> 2 </Address>
<HomePage>www.throstlehotel.com.cn</HomePage>
<E-Mail>[email protected]</E-Mail>
<TelePhone>(099)9886666</TelePhone>
<Grade> </Grade>
</Hotel>
</HotelList>
</XML>
</body>
</HTML> //xml