gibney.org : Technology : Javascript : Bookmarklets : Tester


just a logo :)

search:


See as: raw | code

terms of service | imprint

gibney.org
is powered by m1d1





Tester
(Entry Nr. 320, by user 1 | edit)
function check() { if (typeof(TestString)=="undefined") { testNext('ok'); return; } // if (TestString.length<1) testNext('ok'); content=document.getElementById("thef").contentWindow.document.body.innerHTML; Test=new RegExp(TestString); Matches=content.match(Test); if (!Matches) alert ("\""+TestString+"\" not found!"); else testNext('ok'); } function testNext(Lastresult) { var TestLines = document.getElementById('tests').value.split("\n"); // lets find the next TestLine: var i=0; while (TestLines[i].substring(0,4)=="ok) " || TestLines[i].substring(0,2)=="//") { i++; if (i==TestLines.length) { delete(TestString); return; } } if (TestLines[i].substring(0,11)=="javascript:") { var Code=TestLines[i].substring(11,9999); eval (Code); } else { var Test = TestLines[i].split(" "); var TestUrl = Test[0]; TestString = Test[1]; if(TestUrl.length<1) return false; theiframe.src=TestUrl; } TestLines[i]="ok) "+TestLines[i]; document.getElementById('tests').value=TestLines.join("\n"); } function reset() { var TestLines = document.getElementById('tests').value.split("\n"); var i=0; while (iNext   |   Reset'; document.getElementsByTagName('body').item(0).appendChild(thediv);
Create a new entry at this position