mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[test] alert -> window.alert for easier testing
This commit is contained in:
parent
edb71b8262
commit
28b8154aff
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.URL;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -17,7 +17,7 @@ First Name: <input name="fname" type="text" value="Doug">
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.anchors.item(1).outerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -17,7 +17,7 @@ function myFunction() {
|
||||
var textnode = document.createTextNode("Water");
|
||||
node.appendChild(textnode);
|
||||
document.getElementById("myList").appendChild(node);
|
||||
alert(document.getElementsByTagName("HTML")[0].outerHTML);
|
||||
window.alert(document.getElementsByTagName("HTML")[0].outerHTML);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
function myFunction() {
|
||||
var a = document.getElementsByTagName("BUTTON")[0];
|
||||
var x = a.attributes.getNamedItem('onclick').value;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = "Avail Height: " + screen.availHeight + "px";
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = "Avail Width: " + screen.availWidth + "px";
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.baseURI;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.body.id;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -5,12 +5,12 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').childElementCount);
|
||||
window.alert(document.getElementById('blabla').childElementCount);
|
||||
}
|
||||
|
||||
function bb()
|
||||
{
|
||||
alert(document.getElementById('empty').childElementCount);
|
||||
window.alert(document.getElementById('empty').childElementCount);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -9,13 +9,13 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('aaaa').className);
|
||||
window.alert(document.getElementById('aaaa').className);
|
||||
}
|
||||
|
||||
function bb()
|
||||
{
|
||||
document.getElementById('aaaa').className = 'abc';
|
||||
alert(document.getElementsByTagName("BODY")[0].outerHTML);
|
||||
window.alert(document.getElementsByTagName("BODY")[0].outerHTML);
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">Click me!</button>
|
||||
|
@ -24,7 +24,7 @@
|
||||
function myFunction() {
|
||||
var span = document.getElementById("mySPAN");
|
||||
var div = document.getElementById("myDIV").contains(span);
|
||||
alert(div);
|
||||
window.alert(div);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -9,16 +9,16 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert('aaaa ' + document.getElementById('aaaa').dir);
|
||||
alert('blabla ' + document.getElementById('blabla').dir);
|
||||
alert('ble ' + document.getElementById('ble').dir);
|
||||
alert('bb ' + document.getElementById('bb').dir);
|
||||
window.alert('aaaa ' + document.getElementById('aaaa').dir);
|
||||
window.alert('blabla ' + document.getElementById('blabla').dir);
|
||||
window.alert('ble ' + document.getElementById('ble').dir);
|
||||
window.alert('bb ' + document.getElementById('bb').dir);
|
||||
}
|
||||
|
||||
function bb()
|
||||
{
|
||||
document.getElementById('blabla').dir = 'ltr';
|
||||
alert('blabla ' + document.getElementById('blabla').dir);
|
||||
window.alert('blabla ' + document.getElementById('blabla').dir);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.doctype.name;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.documentElement.innerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.documentURI;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.domain;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').id);
|
||||
window.alert(document.getElementById('blabla').id);
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">Click me!</button>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').firstChild.id);
|
||||
window.alert(document.getElementById('blabla').firstChild.id);
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">Click me!</button>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').firstElementChild.outerHTML);
|
||||
window.alert(document.getElementById('blabla').firstElementChild.outerHTML);
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">blabla firstElementChild outerHTML</button>
|
||||
|
@ -9,12 +9,12 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').getAttribute('rel'));
|
||||
window.alert(document.getElementById('blabla').getAttribute('rel'));
|
||||
}
|
||||
|
||||
function bb()
|
||||
{
|
||||
alert(document.getElementById('ble').getAttribute('href'));
|
||||
window.alert(document.getElementById('ble').getAttribute('href'));
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">blabla rel nofollow</button>
|
||||
|
@ -16,7 +16,7 @@
|
||||
function myFunction() {
|
||||
var elmnt = document.getElementsByTagName("H1")[0];
|
||||
var attr = elmnt.getAttributeNode("class").value;
|
||||
alert(attr);
|
||||
window.alert(attr);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
@ -14,7 +14,7 @@ First Name: <input name="fname" type="text" value="Doug">
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementsByClassName("test").item(1).outerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -14,7 +14,7 @@ First Name: <input name="fname" type="text" value="Doug">
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementsByName("fname").item(1).outerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -14,7 +14,7 @@ First Name: <input name="fname" type="text" value="Doug">
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementsByTagName("P").item(1).outerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -9,12 +9,12 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').hasAttribute('rel'));
|
||||
window.alert(document.getElementById('blabla').hasAttribute('rel'));
|
||||
}
|
||||
|
||||
function bb()
|
||||
{
|
||||
alert(document.getElementById('ble').hasAttribute('href'));
|
||||
window.alert(document.getElementById('ble').hasAttribute('href'));
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">blabla rel true</button>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').hasAttributes());
|
||||
window.alert(document.getElementById('blabla').hasAttributes());
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">blabla has attributes</button>
|
||||
|
@ -20,7 +20,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var list = document.getElementById("myList").hasChildNodes();
|
||||
alert(list);
|
||||
window.alert(list);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.head.innerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = "Height: " + screen.height + "px";
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.images.length;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').innerHTML);
|
||||
alert(document.getElementById('ble').innerHTML);
|
||||
window.alert(document.getElementById('blabla').innerHTML);
|
||||
window.alert(document.getElementById('ble').innerHTML);
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">Click me!</button>
|
||||
|
@ -9,14 +9,14 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').innerHTML);
|
||||
alert(document.getElementById('ble').innerHTML);
|
||||
window.alert(document.getElementById('blabla').innerHTML);
|
||||
window.alert(document.getElementById('ble').innerHTML);
|
||||
}
|
||||
|
||||
function bb()
|
||||
{
|
||||
document.getElementById('blabla').innerHTML = '<u>test</u><b>OK</b>';
|
||||
// alert(document.getElementsByTagName("HTML")[0].outerHTML);
|
||||
// window.alert(document.getElementsByTagName("HTML")[0].outerHTML);
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">Click me!</button>
|
||||
|
@ -20,7 +20,7 @@ function myFunction() {
|
||||
newItem.appendChild(textnode);
|
||||
var list = document.getElementById("myList");
|
||||
list.insertBefore(newItem, list.firstChild);
|
||||
alert(document.getElementsByTagName("BODY")[0].outerHTML);
|
||||
window.alert(document.getElementsByTagName("BODY")[0].outerHTML);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -24,7 +24,7 @@ function myFunction(x,y) {
|
||||
var item1 = document.getElementById(x).firstChild;
|
||||
var item2 = document.getElementById(y).firstChild;
|
||||
var x = item1.isEqualNode(item2);
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -19,7 +19,7 @@ function myFunction() {
|
||||
var item1 = document.getElementById("myList");
|
||||
var item2 = document.getElementsByTagName("UL")[0];
|
||||
var x = item1.isSameNode(item2);
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('aaaa').lang);
|
||||
window.alert(document.getElementById('aaaa').lang);
|
||||
}
|
||||
|
||||
function bb()
|
||||
|
@ -7,7 +7,7 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').lastChild.innerHTML);
|
||||
window.alert(document.getElementById('blabla').lastChild.innerHTML);
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">Click me!</button>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').lastElementChild.outerHTML);
|
||||
window.alert(document.getElementById('blabla').lastElementChild.outerHTML);
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">blabla lastElementChild outerHTML</button>
|
||||
|
@ -26,7 +26,7 @@ First Name: <input name="fname" type="text" value="Doug">
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.links.length;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
<p><button onclick="javascript:{ alert(location.hash); }">Display location.hash.</button></p>
|
||||
<p><button onclick="javascript:{ alert(location.host); }">Display location.host.</button></p>
|
||||
<p><button onclick="javascript:{ alert(location.hostname); }">Display location.hostname.</button></p>
|
||||
<p><button onclick="javascript:{ alert(location.origin); }">Display location.origin.</button></p>
|
||||
<p><button onclick="javascript:{ alert(location.pathname); }">Display location.pathname.</button></p>
|
||||
<p><button onclick="javascript:{ alert(location.port); }">Display location.port.</button></p>
|
||||
<p><button onclick="javascript:{ alert(location.search); }">Display location.search.</button></p>
|
||||
<p><button onclick="javascript:{ window.alert(location.hash); }">Display location.hash.</button></p>
|
||||
<p><button onclick="javascript:{ window.alert(location.host); }">Display location.host.</button></p>
|
||||
<p><button onclick="javascript:{ window.alert(location.hostname); }">Display location.hostname.</button></p>
|
||||
<p><button onclick="javascript:{ window.alert(location.origin); }">Display location.origin.</button></p>
|
||||
<p><button onclick="javascript:{ window.alert(location.pathname); }">Display location.pathname.</button></p>
|
||||
<p><button onclick="javascript:{ window.alert(location.port); }">Display location.port.</button></p>
|
||||
<p><button onclick="javascript:{ window.alert(location.search); }">Display location.search.</button></p>
|
||||
<a id="test" href="/">a</a>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementsByTagName("P")["myElement"];
|
||||
alert(x.innerHTML);
|
||||
window.alert(x.innerHTML);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById("item1").nextElementSibling.innerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -20,7 +20,7 @@ is considered as nodes.</p>
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById("item1").nextSibling.innerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById("myP").firstChild.nodeName;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById("myP").firstChild.nodeType;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById("myP").firstChild.nodeValue;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
alert(document.getElementById('blabla').outerHTML);
|
||||
alert(document.getElementById('ble').outerHTML);
|
||||
window.alert(document.getElementById('blabla').outerHTML);
|
||||
window.alert(document.getElementById('ble').outerHTML);
|
||||
}
|
||||
</script>
|
||||
<button onclick="return aa()">Click me!</button>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x= document.getElementById("myP").ownerDocument.nodeType;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById("myLI").parentElement.tagName;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById("myLI").parentNode.tagName;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById("item2").previousElementSibling.innerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -20,7 +20,7 @@ is considered as nodes.</p>
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.getElementById("item2").previousSibling.innerHTML;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.doctype.publicId;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
<script>
|
||||
function myFunction() {
|
||||
alert(document.querySelector(".example").innerHTML);
|
||||
window.alert(document.querySelector(".example").innerHTML);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -17,13 +17,13 @@ function myFunction() {
|
||||
var x, i;
|
||||
x = document.querySelectorAll(".example");
|
||||
for (i = 0; i < x.length; i++) {
|
||||
alert(i + ' ' + x[i].outerHTML);
|
||||
window.alert(i + ' ' + x[i].outerHTML);
|
||||
}
|
||||
}
|
||||
|
||||
function myFunction2() {
|
||||
x = document.querySelectorAll(".example6");
|
||||
alert(x.length);
|
||||
window.alert(x.length);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -14,13 +14,13 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var a = document.getElementsByTagName("HTML")[0];
|
||||
alert(a.outerHTML);
|
||||
window.alert(a.outerHTML);
|
||||
}
|
||||
|
||||
function myFunction2() {
|
||||
document.getElementById('demo').remove();
|
||||
var a = document.getElementsByTagName("HTML")[0];
|
||||
alert(a.outerHTML);
|
||||
window.alert(a.outerHTML);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
var x = document.scripts.length;
|
||||
alert(x);
|
||||
window.alert(x);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -8,7 +8,7 @@ function scrollText() {
|
||||
}
|
||||
function scroll() {
|
||||
document.title = scrollText();
|
||||
setTimeout("scroll()", 100);
|
||||
window.setTimeout("scroll()", 100);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<script>
|
||||
function myFunction() {
|
||||
document.getElementsByTagName("H1")[0].setAttribute("class", "democlass");
|
||||
alert(document.getElementsByTagName("HTML")[0].outerHTML);
|
||||
window.alert(document.getElementsByTagName("HTML")[0].outerHTML);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user