home
-
new
-
log
- v0.5.5 :u: blObj.
this.blMp4Player = function (){ this.blMp4Player.blV = "v0.5.4"; this.blMp4Player.u1 = "v0.5.4:: 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"; d.appendChild(v); this.blMp4Player.v = v; this.blMp4Player.d = d; } }
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 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) { xmlhttp.boss.innerHTML = 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"); o.ajax = new blAjax(); o.ajax.getData(o,"http://api.baidao.com/api/hq/npdata.do?ids=201");
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");}