87,910
社区成员
发帖
与我相关
我的任务
分享
Function BytesToBstr(body)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = "GB2312"
'转换原来默认的UTF-8编码转换成GB2312编码,否则直接用XMLHTTP调用有中文字符的网页得到的将是乱码
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
<script language="javascript">
function cloneCode(){
frm2.document.getElementById("txt").value = (typeof(HTMLElement) != "undefined"?
frm1.document.createElement("DIV").appendChild(frm1.document.documentElement.cloneNode(true)).parentNode.innerHTML
:
frm1.document.documentElement.outerHTML
)
}
</script>
<div><input type="button" value="LeftFrame's code To RightFrame's TextArea" onclick="cloneCode()" /></div>
<div style="float:left">
<iframe id="frm1" name="frm1" style="width:400px;height:400px" src="left.htm"></iframe>
</div>
<div style="float:left">
<iframe id="frm2" name="frm2" style="width:400px;height:400px" src="right.htm"></iframe>
</div>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>网页标题</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function hello(){
alert('Hello!');
}
</script>
</head>
<body>
LeftFrame
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>网页标题</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
RightFrame<br /><br />
<textarea id="txt" name="txt" style="width:360px;height:300px">code...</textarea>
</body>
</html>