function getComputerName()
{
var objWMIService = GetObject("Winmgmts:root\cimv2");
for(e = new Enumerator(objWMIService) ; !e.atEnd() ; e.moveNext())
{
var getComputer = e.item();
return getComputer.Name;
}
}
//条件编译
<script language=javascript>
/*@cc_on @*/
/*@if (@_win32 && @_jscript_version>5)
function window.confirm(str)
{
execScript("n = msgbox('"+ str +"', 257)", "vbscript");
return(n == 1);
}
@end @*/
</script>
//取得innerText
<SCRIPT LANGUAGE="JavaScript">
<!--
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var currNode;
xmlDoc.async = false;
xmlDoc.async = false;
xmlDoc.loadXML("<TABLENAME> 你好你阿三 大法 司法等四 </TABLENAME>");
currNode = xmlDoc.documentElement;
var s = currNode.xml;
var r = /\<([^\>\s]*?)[^\>]*?\>([^\<]*?)\<\/\1\>/
var b = s.replace(r,"$2");
alert(b);
//-->
</SCRIPT>
//mergeAttributes 复制所有读/写标签属性到指定元素。
<SCRIPT>
function fnMerge(){
oSource.children[1].mergeAttributes(oSource.children[0]);
}
</SCRIPT>
<SPAN ID=oSource>
<DIV
ID="oDiv"
ATTRIBUTE1="true"
ATTRIBUTE2="true"
onclick="alert('click');"
onmouseover="this.style.color='#0000FF';"
onmouseout="this.style.color='#000000';"
>
This is a sample <B>DIV</B> element.
</DIV>
<DIV ID="oDiv2">
This is another sample <B>DIV</B> element.
</DIV>
</SPAN>
<INPUT
TYPE="button"
VALUE="Merge Attributes"
onclick="fnMerge()"
>
将选中内容保存为html
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function save()
{
var f;
f = document.getElementById("xx");
if(f==null)
{
document.appendChild(document.createElement("<iframe id=xx name=xx width=0 height=0></iframe>"));
f = document.getElementById("xx");
}
var fa = window.frames["xx"];
fa.document.write(document.selection.createRange().htmlText);
fa.document.close();
fa.document.execCommand("saveas",true,"a.htm");
}
//-->
</SCRIPT>
<BODY>
<UL>
<LI><FONT size=2><STRIKE>显示版块帖子</STRIKE> </FONT>
<LI><FONT size=2>版块帖子分页 </FONT>
<LI><FONT size=2><STRIKE>显示单个帖子</STRIKE> </FONT>
<LI><FONT size=2><STRIKE>发送新帖</STRIKE></FONT>
<LI><FONT size=2><STRIKE>帖子回复</STRIKE> </FONT>
<LI><FONT size=2><STRIKE>个人登陆</STRIKE> </FONT>
<LI><FONT size=2>留言的回复功能</FONT></LI></UL>
<input type=button onclick="save()" value="aa">
</BODY>
</HTML>
判断是刷新还是离开