VML绘图板⑤浏览--view.php
发表于:2007-07-01来源:作者:点击数:
标签:
html xmlns:v=urn:schemas-microsoft-com:vml / head meta http-equiv=Content-type content=text/html; charset=gb2312 titleVML绘图板/title style v\:* { behavior: url(#default#VML); } td { font-size:9pt; } /style /head script src=XMLtool.js/scrip
<html>
<xmlns:v="urn:schemas-microsoft-com:vml" />
<head>
<meta http-equiv="Content-type" content="text/html; charset=gb2312">
<title>VML绘图板</title>
<style>
v\:* { behavior: url(#default#VML); }
td { font-size:9pt; }
</style>
</head>
<script src="XMLtool.js"></script>
<script>
// 钩子函数,用于清除代码显示
function hooke() {
code.innerText = "";
}
// 从
服务器获取XML文档。服务器将返回vml文档,可以根据参数v简单的用readfile函数
function loadXML(v)
{
var xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
xmlHTTP.open("GET","server.
php?info="+v,false);
xmlHTTP.setRequestHeader("Contrn-type","text/xml");
xmlHTTP.setRequestHeader("Contrn-charset","gb2312");
xmlHTTP.send(v);
view.innerHTML = xmlHTTP.responseText;
hooke();
if(xmlHTTP.responseText.indexOf("Error:")!=-1) {
alert(xmlHTTP.responseText);
}
}
// 以下函数用于与vml文档交互
function cursor() {}
function mouse_down() {}
function mouse_up() {}
function setOverColor() {}
function setOutColor() {}
function deleteNode() {}
</script>
<body onLoad="loadXML(1)">
<table>
<tr>
<td>作品展示</td>
</tr>
<tr>
<td id="view"></td>
</tr>
<tr>
<td>
<?php
// 变量num为保存的vml文档总数,这里仅简单的指定。请根据实际的组织调整
$num = 10;
for($i=1;$i<=$num;$i++)
echo sprintf("<span style=\"cursor:hand;\" onClick=\"loadXML(%d)\" nobr>%4d</span>\n",$i,$i);
?>
</td>
</tr>
<tr>
<td style="cursor:help;" onClick="code.innerText=view.innerHTML">查看VML代码</td>
</tr>
<tr>
<td id="code"></td>
</tr>
</table>
</body>
</html>
原文转自:http://www.ltesting.net