home
-
new
-
log
- v0.9.1 :+: get sell:
function blAjax(){ this.getData = function (oBoss,src) { if(!oBoss){alert("boss error!");return;} if(oBoss){ var xmlhttp; if (window.XMLHttpRequest) {//"code for IE7+, Firefox, Chrome, Opera, Safari" xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.boss = oBoss; xmlhttp.src = src; xmlhttp.parseData = function(txt) { var d = document.getElementById("idParseData"); if(!d){ d = document.createElement("div"); d.id = "idParseData"; xmlhttp.boss.appendChild(d); d.n = 0; d.style.border = "red 1px solid"; } d.n++; var j = JSON.parse(txt); var j1 = j[0]; d.innerHTML = d.n + " sell: " + j1.sell+ " - " + j1.updatetime + "
" + txt; xmlhttp.boss.ajax.getData(xmlhttp.boss,xmlhttp.src); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { xmlhttp.parseData(xmlhttp.responseText); } } xmlhttp.open("GET",src,true); xmlhttp.send(); } } } var o = document.getElementById("d11"); if(o) { o.ajax = new blAjax(); o.ajax.getData(o,"http://api.baidao.com/api/hq/npdata.do?ids=201"); } else { alert("No div 'd11'!"); }
this.blMp4Player = function (){ this.blMp4Player.blV = "v0.5.9"; this.blMp4Player.v059 = "+: if(f.length>1) document.blLoadOK = true;"; this.blMp4Player.v058 = "m: d.id = i; auto play next song"; this.blMp4Player.v057 = "+: v.playObj"; this.blMp4Player.v056 = "+: onclick : to play"; this.blMp4Player.v055 = "+: idDirLyr"; this.blMp4Player.v054 = "work as: this.blMp4Player"; var d = document.getElementById("idDivBlMp4Player"); if(!d){ d = document.createElement("div"); d.id = "idDivBlMp4Player"; d.style.border = "1px solid green"; document.body.appendChild(d); var v = document.createElement("video"); v.id = "idBlMp4Player"; v.volume = 0.2; d.appendChild(v); v.oLast = null; v.playObj = function (o){ if(v.oLast) { v.oLast.style.backgroundColor = "green";} v.src = o.innerHTML; v.play(); o.style.backgroundColor="yellow"; v.oLast = o; } var l = document.createElement("div"); l.id = "idDivLyr"; l.style.border = "1px solid red"; d.appendChild(l); this.blMp4Player.v = v; this.blMp4Player.d = d; } this.blMp4Player.blMakeList = function(){ var boss = document.getElementById("idDivBlMp4Player"); for (var i = 1; i
1) document.blLoadOK = true; } this.blMp4Player.myTimeFun = function(){ var p = document.getElementById("idBlMp4Player"); var lr = document.getElementById("idDivLyr"); lr.innerHTML = new Date(); if(p.ended){ var v = document.getElementById("idBlMp4Player"); var id = parseInt(v.oLast.id)+1; var b = document.getElementById(id); if(b==null) b = document.getElementById("1"); b.click(); } } setInterval(this.blMp4Player.myTimeFun, 1000); } this.blMp4Player(); this.blMp4Player.blMakeList();
this.blShowObj = function(obj){ this.blShowObj.blV = "v0.5.2"; var oBoss = document.getElementById("divBlShowObj"); if(!oBoss) { oBoss = document.createElement("div"); oBoss.id = "divBlShowObj"; oBoss.style.border = "green 1px solid"; document.body.appendChild(oBoss); } if(!oBoss){ alert("boss error!");return; } oBoss.innerHTML = ""; for(i in obj) { var b = document.createElement("button"); b.id = b.innerHTML = i; if(i[0]=="b"&&i[1]=="l") b.style.backgroundColor = "yellow"; oBoss.appendChild(b); var d = document.createElement("div"); d.innerHTML = obj[i]; d.style.border = "blue 1px solid"; d.style.backgroundColor = "green"; d.style.color = "yellow"; oBoss.appendChild(d); } } this.blShowObj(this.blShowObj);
function blKlines(idBossDiv,id,src){ var r = document.getElementById(id); if(!r){ r = document.createElement("canvas"); r.id = id; } r.src = src; r.style.border = "red 1px solid"; var boss = document.getElementById(idBossDiv); if(!boss) {alert("need exist div as boss.");return r; } boss.appendChild(r); r.boss = boss; r.onclick = function(){alert("Klines click");} return r; } var k1 = blKlines("d2","k1","k.js"); k1.boss.onclick = function(){k1.click();alert("k1.boss");}
function blScript(id,src){ var r = document.getElementById(id); if(!r){ r = document.createElement("script"); r.id = id; } r.src = src; document.body.appendChild(r); return r; } var s1 = blScript("s1","m.js");
function blIframe(id,src){ var r = document.getElementById(id); if(!r){ r = document.createElement("iframe"); r.id = id; r.style.border = "1px solid red"; } r.src = src; document.body.appendChild(r); return r; } var i1 = blIframe("i1","mi.bat"); var i2 = blIframe("i2","mp4i.bat");
function blCanvas(id,html){ var r = document.getElementById(id); if(!r){ r = document.createElement("canvas"); r.id = id; r.style.border = "1px solid blue"; } r.innerHTML = html; r.onclick = function(){alert(id);} document.body.appendChild(r); return r; } var c1 = blCanvas("c1","c1"); var c2 = blCanvas("c2","c2"); c2.onclick = function(){alert("CCCC2");} c2.onmousemove = function(){ var c = document.getElementById("c2"); var ctx = c.getContext("2d"); ctx.beginPath(); var w = this.width; var h = this.height; ctx.fillStyle = "red"; ctx.fillRect(0,0,w,h); var coord = coordinate(event); var x = coord.coord_X; var y = coord.coord_Y; ctx.moveTo(0,0); ctx.lineTo(x,y); var r = 20; ctx.arc(x,y,r,0,2*Math.PI); ctx.stroke(); ctx.font = "20px Arial"; ctx.fillStyle = "blue"; var s = "("+x+","+y+")"; ctx.fillText(s,x,y); }
function blDiv(id,html){ var r = document.getElementById(id); if(!r){ r = document.createElement("div"); r.id = id; r.style.border = "1px solid #3d3d3d"; } r.innerHTML = html; r.onclick = function(){alert(id);} document.body.appendChild(r); return r; } var d1 = blDiv("d11","d1b"); var d2 = blDiv("d2","d2"); d2.onclick = function(){alert("ddfdd2");}
function blBtn(id,html){ var r = document.getElementById(id); if(!r){ r = document.createElement("button"); r.id = id; } r.innerHTML = html; r.onclick = function(){alert(id);} document.body.appendChild(r); return r; } var b1 = blBtn("b1","b1b"); var b2 = blBtn("b2","x2"); b2.onclick = function(){alert("x2");}