VML繪圖板⑤瀏覽--view.php

來源:互聯網
上載者:User
<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>


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.