VML绘图板②脚本

脚本**************
VMLgraph.js*************var xo=0;var yo=0;var ox=80;var
oy=20;var dx=0;var dy=0;var drawKey = false;var itemID = 0;var
ShapeItemNum = 0;var ShapeItemX = 0;var ShapeItemY = 0;var CurveItemNum
= 0;var NodeDelete = false;var ToolBarNum = 2; // 预置的工具编号var
gradientX = -1;function cursor(kState of Qatar {xo = event.clientX – ox;yo =
event.clientY – oy;if(k && xo=0 && yo=0卡塔尔国oxy.innerHTML =
xo+”,”+yo;elseoxy.innerHTML = “”;if(drawKey卡塔尔 {paint(卡塔尔(قطر‎;view.innerHTML =
tree(canvas.documentElement,0卡塔尔(قطر‎;}}function setOverColor(v卡塔尔国 {if(!
NodeDelete) return;v.myColor = v.strokecolor;if(v.strokecolor ==
“red”)v.strokecolor=’#澳门新葡萄京官网注册,000000′;elsev.strokecolor=’#ff0000′;}function
setOutColor(v) {if(! NodeDelete) return;v.strokecolor =
v.myColor;view.innerHTML = tree(canvas.documentElement,0);}function
deleteNode(v) {if(! NodeDelete) return;var id =
v.id;for(i=0;icanvas.selectNodes(“/*//*”).length;i++) {var node =
canvas.selectNodes(“/*//*”)[i];if(node.getAttribute(“id”) == id)
{canvas.documentElement.childNodes[0].removeChild(node);view.innerHTML
= tree(canvas.documentElement,0);return;}}}function setElement(node)
{node.setAttribute(“id”) = itemID;node.setAttribute(“myColor”) = “#”;
node.setAttribute(“onMouseOver”) =
“setOverColor(this)”;node.setAttribute(“onMouseOut”) =
“setOutColor(this)”;node.setAttribute(“onClick”) =
“deleteNode(this)”;var subobjField =
canvas.createElement(“v:stroke”);subobjField.setAttribute(“color”) =
color1.fillcolor;subobjField.setAttribute(“dashstyle”) =
dashstyle.dashstyle;node.appendChild(subobjField);if(textbox.style.visibility
== “visible” && txt.value.length) {var subobjField =
canvas.createElement(“v:path”);subobjField.setAttribute(“textpathok”) =
“true”;node.appendChild(subobjField);var subobjField =
canvas.createElement(“v:textpath”);subobjField.setAttribute(“on”) =
“true”;subobjField.setAttribute(“string”) =
txt.value;subobjField.setAttribute(“style”) = “font:normal normal normal
16pt ‘Arial
Black'”;node.appendChild(subobjField);}canvas.documentElement.childNodes[0].appendChild(node);}function
mouse_down() {drawKey = true;dx = xo;dy = yo;itemID++;if(ToolBarNum !=
7) ShapeItemNum = 0;switch(ToolBarNum) {case 3:var objField =
canvas.createElement(“v:line”);objField.setAttribute(“from”) =
xo+”,”+yo;objField.setAttribute(“to”) = xo+”,”+yo;return
setElement(objField);case 4:if(CurveItemNum == 0) {CurveItemNum = 1;var
objField = canvas.createElement(“v:curve”);objField.setAttribute(“from”)
= xo+”,”+yo;objField.setAttribute(“to”) =
xo+”,”+yo;objField.setAttribute(“control1″) =
xo+”,”+yo;objField.setAttribute(“control2″) = xo+”,”+yo;var subobjField
= canvas.createElement(“v:fill”);subobjField.setAttribute(“opacity”) =
0;objField.appendChild(subobjField);return
setElement(objField);}return;case 9:var objField =
canvas.createElement(“v:polyline”);objField.setAttribute(“points”) =
xo+”,”+yo+” “+xo+”,”+yo;var subobjField =
canvas.createElement(“v:fill”);subobjField.setAttribute(“opacity”) =
0;objField.appendChild(subobjField);return setElement(objField);case
7:if(ShapeItemNum == 0) {var objField =
canvas.createElement(“v:shape”);objField.setAttribute(“style”) =
“width:500; height:309”;objField.setAttribute(“path”) = “m “+xo+”,”+yo+”
l “+xo+”,”+yo;ShapeItemX = xo;ShapeItemY = yo;}else {objField =
canvas.documentElement.childNodes[0].lastChild;objField.setAttribute(“path”)
= objField.getAttribute(“path”) + ”
“+xo+”,”+yo;return;}ShapeItemNum++;break;case 5:var objField =
canvas.createElement(“v:rect”);break;case 6:var objField =
canvas.createElement(“v:roundrect”);objField.setAttribute(“arcsize”) =
0.2;break;case 8:var objField =
canvas.createElement(“v:oval”);break;case 10:s = “”;s =
tree(canvas.documentElement,1);view.innerHTML = s;
return;defaule:drawKey = false;return;}if(objField) {if(ToolBarNum !=
7)objField.setAttribute(“style”) = “left:”+xo+”; top:”+yo+”; width:0;
height:0;”;var subobjField =
canvas.createElement(“v:fill”);subobjField.setAttribute(“opacity”) =
gradientBar.opacity;subobjField.setAttribute(“angle”) =
gradientBar.angle;subobjField.setAttribute(“type”) =
gradientBar.type;subobjField.setAttribute(“color”) =
gradientBar.color.value;subobjField.setAttribute(“color2”) =
gradientBar.color2.value;subobjField.setAttribute(“colors”) =
gradientBar.colors.value;subobjField.setAttribute(“focusposition”) =
gradientBar.focusposition;objField.appendChild(subobjField);return
setElement(objField);}return;}function mouse_up() {drawKey =
false;if(CurveItemNum 0) CurveItemNum++;if(CurveItemNum 3) CurveItemNum
= 0;if(ToolBarNum == 7) {if(Math.abs(xo – ShapeItemX) 2 && Math.abs(yo –
ShapeItemY) 2) {ShapeItemNum = 0;Element =
canvas.documentElement.childNodes[0].lastChild;var regerp = /
[0-9]+,[0-9]+$/var str =
Element.getAttribute(“path”);Element.setAttribute(“path”) =
str.replace(regerp,” x e”);view.innerHTML =
tree(canvas.documentElement,0);}}}function paint() {Element =
canvas.documentElement.childNodes[0].lastChild;var x0,y0,x1,y1;x0 =
Math.min(dx,xo);y0 = Math.min(dy,yo);x1 = Math.max(dx,xo);y1 =
Math.max(dy,yo);var box = “left:”+x0+”; top:”+y0+”; width:”+(x1-x0)+”;
height:”+(y1-y0)+”;”;switch(ToolBarNum) {case 4:if(CurveItemNum ==2)
{Element.setAttribute(“control1″) =
xo+”,”+yo;Element.setAttribute(“control2”) =
Element.getAttribute(“to”);break;}if(CurveItemNum ==3)
{Element.setAttribute(“control2″) = xo+”,”+yo;break;}case
3:Element.setAttribute(“to”) = xo+”,”+yo;break;case 7:var regerp =
/[0-9]+,[0-9]+$/var str =
Element.getAttribute(“path”);Element.setAttribute(“path”) =
str.replace(regerp,xo+”,”+yo);break;case 5:case 6:case 8:var regerp =
/left.+height:[0-9]+;/var str =
Element.getAttribute(“style”);Element.setAttribute(“style”) =
str.replace(regerp,box);break;case 9:var regerp = /
[0-9]+,[0-9]+$/var str =
Element.getAttribute(“points”);Element.setAttribute(“points”) = str+”
“+xo+”,”+yo;break;defaule:break;}}function init()
{tool_box_refresh(卡塔尔(قطر‎;// 工具栏伊始view.innerHTML =
tree(canvas.documentElement卡塔尔国;// 绘图区初步color.innerHTML =
tree(tools.selectNodes(“*/colorbar”)[0]卡塔尔(قطر‎;//
颜色筛选开始linebox.innerHTML =
tree(tools.selectNodes(“*/linebox”)[0]State of Qatar;//
线型选拔起来gradientBox.innerHTML =
tree(tools.selectNodes(“*/gradient”)[0]State of Qatar;// 充填选取起来}//
绘制工具栏function tool_box_refresh() {var buffer = “”;var
i;for(i=0;itools.selectNodes(“*/toolbar”).length;i++) {var node =
tools.selectNodes(“*/toolbar”)[i];var id =
node.getAttribute(“id”);node.childNodes[0].setAttribute(“onClick”) =
“tool_box_select(“+id+”,this.title)”;var node1 =
node.selectNodes(“*/v:rect”)[0];if(id == ToolBarNum)
{node1.setAttribute(“fillcolor”) =
“#ffcccc”node1.setAttribute(“strokecolor”) = “#ff0000”}else
{node1.setAttribute(“fillcolor”) =
“#ffffff”node1.setAttribute(“strokecolor”) = “#000000”}buffer +=
tree(node.childNodes[0]卡塔尔;}toolbox.innerHTML = buffer;}//
工具选取function tool_box_select(v,t) {var key = ToolBarNum;ToolBarNum
= v;tool_box_refresh();hooke();if(v == 7) {if(key == 7 && ShapeItemNum
0) {Element = canvas.documentElement.childNodes[0].lastChild;var str =
Element.getAttribute(“path”卡塔尔(قطر‎;Element.setAttribute(“path”卡塔尔 = str + ” x
e”;view.innerHTML = tree(canvas.documentElement,0卡塔尔(قطر‎;ShapeItemNum =
0;}}if(v == 10卡塔尔if(textbox.style.visibility ==
“hidden”State of Qatartextbox.style.visibility =
“visible”;elsetextbox.style.visibility = “hidden”;NodeDelete =
false;if(v == 1State of Qatar {NodeDelete = true;view.innerHTML =
tree(canvas.documentElement,0卡塔尔国;}}// 颜色接纳//var setcolorkey =
color1;function setcolor(c卡塔尔国 {var setcolorkey =
color1;setcolorkey.fillcolor = c;}function gradientColor(vState of Qatar {v.fillcolor
= color1.fillcolor;gradientRefresh(卡塔尔;return;var m =
tools.documentElement.selectNodes(“/*/gradient//v:shape”).length;var
node =
tools.documentElement.selectNodes(“/*/gradient//v:shape”);for(i=0;im;i++)
{if(node[i].getAttribute(“id”) ==
v.id)node[i].setAttribute(“fillcolor”) =
color1.fillcolor;}gradientRefresh();}function gradientPoint(v)
{if(gradientX 0)gradientX = xo – 508 – parseInt(v.style.left);n = xo –
508 – gradientX;if(n 8) n = 8;if(n 108) n = 108;v.style.left =
n;gradientRefresh();}function anglePoint(v) {angle.style.left =
Math.floor((xo-516)/25)*25+8;gradientRefresh();}function
opacityPoint(v) {opacity.style.left =
Math.floor((xo-516)/25)*25+8;gradientRefresh();}function settype(v)
{if(v.style.borderColor == “black”)v.style.borderColor =
“red”;elsev.style.borderColor = “black”;gradientRefresh();}function
setGradientX() {gradientX = -1;}function gradientRefresh() {var m =
(parseInt(gradient4.style.left)-parseInt(gradient1.style.left));var n1 =
(parseInt(gradient2.style.left)-parseInt(gradient1.style.left))/m*100;var
n2 =
(parseInt(gradient3.style.left)-parseInt(gradient1.style.left))/m*100;gradientBar.color.value
= gradient1.fillcolor;gradientBar.color2.value =
gradient4.fillcolor;if(type3.style.borderColor ==
“black”)gradientBar.colors.value = “,”;elsegradientBar.colors.value = n1

脚本**************
VMLgraph.js*************var xo=0;var yo=0;var ox=80;var
oy=20;var dx=0;var dy=0;var drawKey = false;var itemID = 0;var
ShapeItemNum = 0;var ShapeItemX = 0;var ShapeItemY = 0;var CurveItemNum
= 0;var NodeDelete = false;var ToolBarNum = 2; // 预置的工具编号var
gradientX = -1;function cursor {xo = event.clientX – ox;yo =
event.clientY – oy;ifoxy.innerHTML = xo+”,”+yo;elseoxy.innerHTML =
“”;if;view.innerHTML = tree(canvas.documentElement,0卡塔尔(قطر‎;}}function
setOverColor return;v.myColor = v.strokecolor;if(v.strokecolor ==
“red”State of Qatarv.strokecolor=’#000000′;elsev.strokecolor=’#ff0000′;}function
setOutColor return;v.strokecolor = v.myColor;view.innerHTML =
tree(canvas.documentElement,0);}function deleteNode return;var id =
v.id;for(i=0;i 0) {Element =
canvas.documentElement.childNodes[0].lastChild;var str =
Element.getAttribute;Element.setAttribute = str + ” x e”;view.innerHTML
= tree(canvas.documentElement,0卡塔尔(قطر‎;ShapeItemNum =
0;}}ifif(textbox.style.visibility == “hidden”State of Qatartextbox.style.visibility =
“visible”;elsetextbox.style.visibility = “hidden”;NodeDelete = false;if
{NodeDelete = true;view.innerHTML = tree(canvas.documentElement,0State of Qatar;}}//
颜色筛选//var setcolorkey = color1;function setcolor {var setcolorkey =
color1;setcolorkey.fillcolor = c;}function gradientColor {v.fillcolor =
color1.fillcolor;gradientRefresh(卡塔尔(قطر‎;return;var m =
tools.documentElement.selectNodes(“/*/gradient//v:shape”).length;var
node = tools.documentElement.selectNodes(“/*/gradient//v:shape”);for
{if(node[i].getAttributenode[i].setAttribute =
color1.fillcolor;}gradientRefresh();}function gradientPointgradientX =
xo – 508 – parseInt;n = xo – 508 – gradientX;if n = 8;if n =
108;v.style.left = n;gradientRefresh();}function anglePoint
{angle.style.left = Math.floor*25+8;gradientRefresh();}function
opacityPoint {opacity.style.left =
Math.floor*25+8;gradientRefresh();}function settype
{if(v.style.borderColor == “black”)v.style.borderColor =
“red”;elsev.style.borderColor = “black”;gradientRefresh();}function
setGradientX() {gradientX = -1;}function gradientRefresh() {var m =
(parseInt-parseInt);var n1 = (parseInt-parseInt)/m*100;var n2 =
(parseInt-parseInt)/m*100;gradientBar.color.value =
gradient1.fillcolor;gradientBar.color2.value =
gradient4.fillcolor;if(type3.style.borderColor ==
“black”)gradientBar.colors.value = “,”;elsegradientBar.colors.value = n1

累计数据 :

  • “% ” + gradient2.fillcolor + “,” + n2 + “% ” +
    gradient3.fillcolor;if(type1.style.borderColor ==
    “black”)gradientBar.type = “solid”;elsegradientBar.type =
    “gradient”;if(type2.style.borderColor == “red”)gradientBar.type =
    “gradientradial”;n1 = (parseInt(focus1.style.left)-8)/m*100;n2 =
    (parseInt(focus2.style.left)-8)/m*100;gradientBar.focusposition.value =
    n1 + “%,” + n2 + “%”;gradientBar.angle = (parseInt(angle.style.left)-8)
    * 3.6;gradientBar.opacity =
    (parseInt(opacity.style.left)-8)/m}**************
    XMLtool.js*************// 传送XML文书档案到服务器function
    saveXML(卡塔尔国{var xmlHTTP = new
    ActiveXObject(“Microsoft.XMLHTTP”State of Qatar;xmlHTTP.open(“POST”,”server.php”,falseState of Qatar;
    //
    使用ASP时用server.aspxmlHTTP.setRequestHeader(“Contrn-type”,”text/xml”State of Qatar;xmlHTTP.setRequestHeader(“Contrn-charset”,”gb2312″State of Qatar;xmlHTTP.send(tree(canvas.documentElement卡塔尔(قطر‎卡塔尔国;var
    s = xmlHTTP.responseText;minview.innerHTML =
    s.replace(/WIDTH:500;HEIGHT:300/,”WIDTH:120;HEIGHT:72″卡塔尔国if(xmlHTTP.responseText.indexOf(“Error:”State of Qatar!=-1卡塔尔(قطر‎{alert(xmlHTTP.responseTextState of Qatar;}}//
    遍历xml对象,分析xml的基本函数集function tree(Element,debugState of Qatar {var buffer
    = “”;var node = “”;if(Element.nodeType != 3) {node = Element;buffer +=
    onElement(Element,debug);}if(Element.nodeType == 3)buffer +=
    onData(Element);if(Element.hasChildNodes) {for(var
    i=0;iElement.childNodes.length;i++) {buffer +=
    tree(Element.childNodes(i),debug);}}if(node)buffer +=
    endElement(node,debug);return buffer;}/*****
    以下多个函数请依据要求活动改正 *****///
    遍历xml对象–节点初步function onElement(Element,debugState of Qatar {var buffer =
    (debug ? “” : “”卡塔尔 + Element.nodeName;n = Element.attributes.lengthif(n0State of Qatar{// 若该节点有参数for(var i=0;in;i++卡塔尔国buffer += ‘ ‘ +
    Element.attributes(i卡塔尔国.name + ‘=/”‘ + Element.attributes(i卡塔尔.value +
    ‘”‘;}buffer += debug ? “” : “”;return buffer;}//
    遍历xml对象–节点甘休function endElement(Element,debugState of Qatar {return (debug ?
    “/” : “/”State of Qatar + Element.nodeName + (debug ? “br” : “”卡塔尔(قطر‎;}//
    遍历xml对象–节点数据function onData(Element卡塔尔国 {return Element.nodeValue}
  • “% ” + gradient2.fillcolor + “,” + n2 + “% ” +
    gradient3.fillcolor;if(type1.style.borderColor ==
    “black”)gradientBar.type = “solid”;elsegradientBar.type =
    “gradient”;if(type2.style.borderColor == “red”)gradientBar.type =
    “gradientradial”;n1 = (parseInt/m*100;n2 =
    (parseInt/m*100;gradientBar.focusposition.value = n1 + “%,” + n2 +
    “%”;gradientBar.angle = (parseInt * 3.6;gradientBar.opacity =
    (parseInt-8)/m}**************
    XMLtool.js*************// 传送XML文书档案到服务器function
    saveXML(State of Qatar{var xmlHTTP = new
    ActiveXObject;xmlHTTP.open(“POST”,”server.php”,false卡塔尔(قطر‎; //
    使用ASP时用server.aspxmlHTTP.setRequestHeader(“Contrn-type”,”text/xml”卡塔尔国;xmlHTTP.setRequestHeader(“Contrn-charset”,”gb2312″卡塔尔国;xmlHTTP.send(tree(canvas.documentElement卡塔尔国卡塔尔(قطر‎;var
    s = xmlHTTP.responseText;minview.innerHTML =
    s.replace(/WIDTH:500;HEIGHT:300/,”WIDTH:120;HEIGHT:72″卡塔尔国if(xmlHTTP.responseText.indexOf
    {alert;}}// 遍历xml对象,拆解深入分析xml的中坚函数集function tree {var buffer =
    “”;var node = “”;if(Element.nodeType != 3卡塔尔 {node = Element;buffer +=
    onElement;}if(Element.nodeType == 3卡塔尔buffer +=
    onData;if(Element.hasChildNodesState of Qatar {for(var i=0;i” : “>”;return
    buffer;}// 遍历xml对象–节点甘休function endElement {return +
    Element.nodeName + (debug ? “>
    ” : “>”State of Qatar;}// 遍历xml对象–节点数据function onData {return
    Element.nodeValue}

数码浮现:

ClassModel.js源码 ::复制代码
代码如下:ClassModel = { create : function { this.construct.apply; } } }
Extend = function { for { desc[c] = src[c]; } return desc; }
Object.prototype.extend = function { return Extend.apply;
}addData.js源码::复制代码
代码如下:var insert = ClassModel.create(卡塔尔(قطر‎; var doc = new
ActiveXObject(“Msxml2.DOMDocument.3.0″卡塔尔国; doc.load; var books;
insert.prototype = { construct : function { this.id = config.id;
this.name = config.name; this.author = config.author; this.price =
config.price; this.publisher = config.publisher; this.count =
config.count; this.insertData(State of Qatar; }, insertData : function(卡塔尔国 { var book =
doc.createElement; book.setAttribute; var name = doc.createElement; var
nameValue = doc.createTextNode; name.appendChild; book.appendChild; var
author = doc.createElement; var authorValue = doc.createTextNode;
author.appendChild; book.appendChild; var price = doc.createElement; var
priceValue = doc.createTextNode; price.appendChild; book.appendChild;
var count = doc.createElement; var countValue = doc.createTextNode;
count.appendChild; book.appendChild; var publisher = doc.createElement;
var publisherValue = doc.createTextNode; publisher.appendChild;
book.appendChild; if(doc.documentElement == null卡塔尔 { books =
doc.createElement; books.appendChild; doc.appendChild; } else { books =
doc.documentElement; books.appendChild; } doc.save; } }
window.js源码::复制代码 代码如下:var
windows = ClassModel.create(卡塔尔国; windows.prototype = { construct :
function { this.title = jsonObject.title; this.width = jsonObject.width;
this.height = jsonObject.height; this.titleColor =
jsonObject.titleColor; this.backgroundColor =
jsonObject.backgroundColor; this.LwHeight = (document.body.clientHeight

  • this.width卡塔尔(قطر‎ / 2; //让div在显示器的中游 this.LwWidth =
    (document.body.clientWidth – this.height卡塔尔(قطر‎ / 2; //让div在荧屏的中间
    this.content = jsonObject.content; var loginWindow =
    this.createLoginBody(卡塔尔(قطر‎; var title = this.createLoginTitle(State of Qatar;
    loginWindow.appendChild; var cont = this.createContent(State of Qatar;
    loginWindow.appendChild; document.body.appendChild; }, createLoginBody:
    function(卡塔尔 //成立登入框, 即整个框 { var loginWindow =
    document.createElement; loginWindow.id = “dialog”; with { border = “1px
    solid white”; position = “absolute”; width = this.width + “px”; height =
    this.height + “px”; top = this.LwHeight + “px”; left = this.LwWidth +
    “px”; backgroundColor = this.backgroundColor; } return loginWindow; },
    createLoginTitle:function(卡塔尔 //创立 标题 即效果图的深红标题 { var title =
    document.createElement; var table = document.createElement; var tbody =
    document.createElement; var tr = document.createElement; var td_1 =
    document.createElement; var td_2 = document.createElement; var close =
    document.createElement; close.onclick = function() {
    document.body.removeChild; } close.innerHTML = “X”; td_1.innerHTML =
    this.title; with { width = “100%”; height = this.height / 10 + “px”;
    backgroundColor = this.titleColor; } with { color = “white”; fontSize =
    “12pt”; width = “100%”; backgroundColor = this.titleColor; color =
    “red”; } td_2.style.textAlign = “right”; td_2.appendChild;
    tr.appendChild; tr.appendChild; tbody.appendChild; table.appendChild;
    title.appendChild; return title; }, createContent : function() { var div
    = document.createElement; if == ‘string’) { div.innerHTML =
    this.content; }else { div.appendChild; } with { paddingLeft = “80px”;
    paddingTop = “50px”; float = “left”; width = “100%”; } return div; } }
    book_infor.js源码:: 复制代码
    代码如下:var doc = new ActiveXObject(“Msxml2.DOMDocument.3.0″卡塔尔(قطر‎;
    doc.load; var query = ClassModel.create(卡塔尔(قطر‎; var v = 0; query.prototype =
    { construct : function; }, bookInfor : function(State of Qatar { var div =
    document.createElement; var root = doc.documentElement; if {
    div.innerHTML = “no data”; document.body.appendChild; }else { with {
    marginLeft = “200px”; overflow = “auto”; border = “0px solid white”;
    width = “605px”; } var table = document.createElement; table.cellSpacing
    = “0”; with { fontSize = “12pt”; color = “white”; border = “0px”; width
    = “600px”; } var tbody = document.createElement; var trHead =
    document.createElement; with { height = “20px”; backgroundColor =
    “Transparent”; } var tname = document.createElement; var tauthor =
    document.createElement; var tprice = document.createElement; var tCount
    = document.createElement; var tpublisher = document.createElement;
    tname.innerHTML = “名称”; tauthor.innerHTML = “作者”; tprice.innerHTML =
    “价格”; tCount.innerHTML = “仓库储存”; tpublisher.innerHTML = “书局”;
    tname.style.borderBottom = “1px solid”; tauthor.style.borderBottom =
    “1px solid”; tprice.style.borderBottom = “1px solid”;
    tCount.style.borderBottom = “1px solid”; tpublisher.style.borderBottom =
    “1px solid”; tname.style.width = “四分之三”; tauthor.style.width = “十分之三”;
    tprice.style.width = “十分四”; tCount.style.width = “三分一”;
    tpublisher.style.width = “33.33%”; trHead.appendChild; trHead.appendChild;
    trHead.appendChild; trHead.appendChild; trHead.appendChild;
    tbody.appendChild; for(var c = 0; c < root.getElementsByTagName { var
    roots = root.getElementsByTagName[c]; var id = roots.getAttribute; var
    name = roots.getElementsByTagName[0].childNodes[0].nodeValue; var
    author = roots.getElementsByTagName[0].childNodes[0].nodeValue; var
    price = roots.getElementsByTagName[0].childNodes[0].nodeValue; var
    count = roots.getElementsByTagName[0].childNodes[0].nodeValue; var
    publisher = roots.getElementsByTagName[0].childNodes[0].nodeValue;
    var tr = document.createElement { backgroundColor = “Transparent”; } var
    tdName = document.createElement; var tdAuthor = document.createElement;
    var tdPrice = document.createElement; var tdCount =
    document.createElement; var tdPublisher = document.createElement;
    tdName.innerHTML = name; tdAuthor.innerHTML = author; tdPrice.innerHTML
    = price; tdCount.innerHTML = count; tdPublisher.innerHTML = publisher;
    tdName.id = “tdName” + c; tdAuthor.id = “tdAuthor” + c; tdPrice.id =
    “tdPrice” + c; tdCount.id = “tdCount” + c; tdPublisher.id =
    “tdPublisher” + c; tr.appendChild; tr.appendChild; tr.appendChild;
    tr.appendChild; tr.appendChild; tbody.appendChild; tdName.onmouseover =
    function(){ document.body.style.cursor= “pointer”;
    document.getElementById.style.backgroundColor = “darkred”; }
    tdName.onmouseout = function(){ document.body.style.cursor= “”;
    document.getElementById.style.backgroundColor = “”; }
    tdAuthor.onmouseover = function(){ document.body.style.cursor=
    “pointer”; document.getElementById.style.backgroundColor = “darkred”; }
    tdAuthor.onmouseout = function(){ document.body.style.cursor= “”;
    document.getElementById.style.backgroundColor = “”; }
    tdPrice.onmouseover = function(){ document.body.style.cursor= “pointer”;
    document.getElementById.style.backgroundColor = “darkred”; }
    tdPrice.onmouseout = function(){ document.body.style.cursor= “”;
    document.getElementById.style.backgroundColor = “”; }
    tdCount.onmouseover = function(){ document.body.style.cursor= “pointer”;
    document.getElementById.style.backgroundColor = “darkred”; }
    tdCount.onmouseout = function(){ document.body.style.cursor= “”;
    document.getElementById.style.backgroundColor = “”; }
    tdPublisher.onmouseover = function(){ document.body.style.cursor=
    “pointer”; document.getElementById.style.backgroundColor = “darkred”; }
    tdPublisher.onmouseout = function(){ document.body.style.cursor= “”;
    document.getElementById.style.backgroundColor = “”; } }
    table.appendChild; div.appendChild; document.body.appendChild; } } }

发表评论

电子邮件地址不会被公开。 必填项已用*标注