代码如下www.602.net

添加数据 :

数据显示:

ClassModel.js源码 ::复制代码
代码如下:ClassModel = { create : function { this.construct.apply; } } }
Extend = function { for { desc[c] = src[c]; } return desc; }
Object.prototype.extend = function { return Extend.apply;
}代码如下www.602.net。addData.js源码::代码如下www.602.net。复制代码
代码如下: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(); }, 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

  • 代码如下www.602.net。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();
    loginWindow.appendChild; var cont = this.createContent();
    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_代码如下www.602.net。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() { 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 = “20%”; tauthor.style.width = “20%”;
    tprice.style.width = “20%”; tCount.style.width = “20%”;
    tpublisher.style.width = “20%”; 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; } } }

发表评论

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