Removed the outdated test files.
Formatted all existing files. Started a scriptapi. Signed-off-by: retep998 <retep998@verizon.net>
This commit is contained in:
parent
44761bed69
commit
3ecea83687
@ -4,26 +4,38 @@
|
|||||||
<script type="text/javascript" src="listener.js"></script>
|
<script type="text/javascript" src="listener.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body name="bodyName" id="bodyId">
|
<body name="bodyName" id="bodyId">
|
||||||
<title name="titleName" id="titleId">This is the title of the document</title><br />
|
<title name="titleName" id="titleId">This is the title of the document</title>
|
||||||
<header name="headerName" id="headerId">This is the header<br />
|
<br />
|
||||||
<nav name="navName" id="navId">This is the navigational menu</nav><br />
|
<header name="headerName" id="headerId">
|
||||||
|
This is the header<br />
|
||||||
|
<nav name="navName" id="navId">This is the navigational menu</nav>
|
||||||
|
<br />
|
||||||
</header>
|
</header>
|
||||||
<table name="tableName" id="tableId"><br />
|
<table name="tableName" id="tableId">
|
||||||
<th name="tableHeadName" id="tableHeadId">table heading</th><br />
|
<br />
|
||||||
<td>Table Cell</td><br />
|
<th name="tableHeadName" id="tableHeadId">table heading</th>
|
||||||
|
<br />
|
||||||
|
<td>Table Cell</td>
|
||||||
|
<br />
|
||||||
</table>
|
</table>
|
||||||
<h1 name="headingName" id="headingId">Level 1 Heading</h1><br />
|
<h1 name="headingName" id="headingId">Level 1 Heading</h1>
|
||||||
|
<br />
|
||||||
<a href="#" id="anchorId" name="anchorName">Anchor</a><br />
|
<a href="#" id="anchorId" name="anchorName">Anchor</a><br />
|
||||||
<object name="objectName" id="objectId">This is an object that normally holds a video but I'm too lazy to find one</object><br />
|
<object name="objectName" id="objectId">This is an object that normally holds a video but I'm too lazy to find one</object><br />
|
||||||
<menu name="menuName" id="menuId">This is a menu</menu><br />
|
<menu name="menuName" id="menuId">This is a menu</menu>
|
||||||
|
<br />
|
||||||
<img src="http://www.natural-environment.com/images/banners/banner_7_glasshouse_mountains.jpg" name="imageName" id="imageId"><br />
|
<img src="http://www.natural-environment.com/images/banners/banner_7_glasshouse_mountains.jpg" name="imageName" id="imageId"><br />
|
||||||
<p name="paraName" id="paraId">This is a paragraph</p><br />
|
<p name="paraName" id="paraId">This is a paragraph</p>
|
||||||
|
<br />
|
||||||
<q name="quoteName" id="quoteId">This is a quotation</q><br />
|
<q name="quoteName" id="quoteId">This is a quotation</q><br />
|
||||||
<summary name="summaryName" id="summaryId">This is a summary</summary><br />
|
<summary name="summaryName" id="summaryId">This is a summary</summary><br />
|
||||||
<time name="timeName" id="timeId">This is a timestamp</time><br />
|
<time name="timeName" id="timeId">This is a timestamp</time><br />
|
||||||
<button value="button" type="button" name="buttonName" id="buttonId" onClick="analyze()">Analyze Javascript</button> <br />
|
<button value="button" type="button" name="buttonName" id="buttonId" onclick="analyze()">Analyze Javascript</button>
|
||||||
<hr name="horizontalRuleName" id="horizontalRuleId"><br />
|
<br />
|
||||||
<form name="formName" id="formId"><br />
|
<hr name="horizontalRuleName" id="horizontalRuleId">
|
||||||
|
<br />
|
||||||
|
<form name="formName" id="formId">
|
||||||
|
<br />
|
||||||
<label name="labelName" id="labelId">This is a label</label><br />
|
<label name="labelName" id="labelId">This is a label</label><br />
|
||||||
<select>
|
<select>
|
||||||
<option value="volvo" name="volvoName" id="volvoId">Volvo</option>
|
<option value="volvo" name="volvoName" id="volvoId">Volvo</option>
|
||||||
|
@ -8,23 +8,18 @@ else if (window.addEventListener) {window.addEventListener('load', your_function
|
|||||||
else { document.addEventListener('load', your_function, false); }
|
else { document.addEventListener('load', your_function, false); }
|
||||||
for (i = 0; i < spans.length; i++)
|
for (i = 0; i < spans.length; i++)
|
||||||
spans[i].addEventListener("click", this.doSomething);
|
spans[i].addEventListener("click", this.doSomething);
|
||||||
function your_function()
|
function your_function() {
|
||||||
{
|
|
||||||
alert("Done Loading!");
|
alert("Done Loading!");
|
||||||
}
|
}
|
||||||
function doSomething(e)
|
function doSomething(e) {
|
||||||
{
|
|
||||||
var targ;
|
var targ;
|
||||||
if (!e)
|
if (!e) {
|
||||||
{
|
|
||||||
var e = window.event;
|
var e = window.event;
|
||||||
}
|
}
|
||||||
if (e.target)
|
if (e.target) {
|
||||||
{
|
|
||||||
targ = e.target;
|
targ = e.target;
|
||||||
}
|
}
|
||||||
else if (e.srcElement)
|
else if (e.srcElement) {
|
||||||
{
|
|
||||||
targ = e.srcElement;
|
targ = e.srcElement;
|
||||||
}
|
}
|
||||||
var tname;
|
var tname;
|
||||||
@ -36,26 +31,38 @@ alert("You clicked on a " + tname + " element. Named "+ idname +".");
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<body name="bodyName" id="bodyId">
|
<body name="bodyName" id="bodyId">
|
||||||
<title name="titleName" id="titleId">This is the title of the document</title><br />
|
<title name="titleName" id="titleId">This is the title of the document</title>
|
||||||
<header name="headerName" id="headerId">This is the header<br />
|
<br />
|
||||||
<nav name="navName" id="navId">This is the navigational menu</nav><br />
|
<header name="headerName" id="headerId">
|
||||||
|
This is the header<br />
|
||||||
|
<nav name="navName" id="navId">This is the navigational menu</nav>
|
||||||
|
<br />
|
||||||
</header>
|
</header>
|
||||||
<table name="tableName" id="tableId"><br />
|
<table name="tableName" id="tableId">
|
||||||
<th name="tableHeadName" id="tableHeadId">table heading</th><br />
|
<br />
|
||||||
<td>Table Cell</td><br />
|
<th name="tableHeadName" id="tableHeadId">table heading</th>
|
||||||
|
<br />
|
||||||
|
<td>Table Cell</td>
|
||||||
|
<br />
|
||||||
</table>
|
</table>
|
||||||
<h1 name="headingName" id="headingId">Level 1 Heading</h1><br />
|
<h1 name="headingName" id="headingId">Level 1 Heading</h1>
|
||||||
|
<br />
|
||||||
<a href="#" id="anchorId" name="anchorName">Anchor</a><br />
|
<a href="#" id="anchorId" name="anchorName">Anchor</a><br />
|
||||||
<object name="objectName" id="objectId">This is an object that normally holds a video but I'm too lazy to find one</object><br />
|
<object name="objectName" id="objectId">This is an object that normally holds a video but I'm too lazy to find one</object><br />
|
||||||
<menu name="menuName" id="menuId">This is a menu</menu><br />
|
<menu name="menuName" id="menuId">This is a menu</menu>
|
||||||
|
<br />
|
||||||
<img src="http://www.natural-environment.com/images/banners/banner_7_glasshouse_mountains.jpg" name="imageName" id="imageId"><br />
|
<img src="http://www.natural-environment.com/images/banners/banner_7_glasshouse_mountains.jpg" name="imageName" id="imageId"><br />
|
||||||
<p name="paraName" id="paraId">This is a paragraph</p><br />
|
<p name="paraName" id="paraId">This is a paragraph</p>
|
||||||
|
<br />
|
||||||
<q name="quoteName" id="quoteId">This is a quotation</q><br />
|
<q name="quoteName" id="quoteId">This is a quotation</q><br />
|
||||||
<summary name="summaryName" id="summaryId">This is a summary</summary><br />
|
<summary name="summaryName" id="summaryId">This is a summary</summary><br />
|
||||||
<time name="timeName" id="timeId">This is a timestamp</time><br />
|
<time name="timeName" id="timeId">This is a timestamp</time><br />
|
||||||
<button value="button" type="button" name="buttonName" id="buttonId">Click Me!</button> <br />
|
<button value="button" type="button" name="buttonName" id="buttonId">Click Me!</button>
|
||||||
<hr name="horizontalRuleName" id="horizontalRuleId"><br />
|
<br />
|
||||||
<form name="formName" id="formId"><br />
|
<hr name="horizontalRuleName" id="horizontalRuleId">
|
||||||
|
<br />
|
||||||
|
<form name="formName" id="formId">
|
||||||
|
<br />
|
||||||
<label name="labelName" id="labelId">This is a label</label><br />
|
<label name="labelName" id="labelId">This is a label</label><br />
|
||||||
<select>
|
<select>
|
||||||
<option value="volvo" name="volvoName" id="volvoId">Volvo</option>
|
<option value="volvo" name="volvoName" id="volvoId">Volvo</option>
|
||||||
|
15
listener.js
15
listener.js
@ -4,23 +4,18 @@ else if (window.addEventListener) {window.addEventListener('load', your_function
|
|||||||
else { document.addEventListener('load', your_function, false); }
|
else { document.addEventListener('load', your_function, false); }
|
||||||
for (i = 0; i < spans.length; i++)
|
for (i = 0; i < spans.length; i++)
|
||||||
spans[i].addEventListener("click", this.doSomething);
|
spans[i].addEventListener("click", this.doSomething);
|
||||||
function your_function()
|
function your_function() {
|
||||||
{
|
|
||||||
alert("Done Loading!");
|
alert("Done Loading!");
|
||||||
}
|
}
|
||||||
function doSomething(e)
|
function doSomething(e) {
|
||||||
{
|
|
||||||
var targ;
|
var targ;
|
||||||
if (!e)
|
if (!e) {
|
||||||
{
|
|
||||||
var e = window.event;
|
var e = window.event;
|
||||||
}
|
}
|
||||||
if (e.target)
|
if (e.target) {
|
||||||
{
|
|
||||||
targ = e.target;
|
targ = e.target;
|
||||||
}
|
}
|
||||||
else if (e.srcElement)
|
else if (e.srcElement) {
|
||||||
{
|
|
||||||
targ = e.srcElement;
|
targ = e.srcElement;
|
||||||
}
|
}
|
||||||
var tname;
|
var tname;
|
||||||
|
3
scriptapi.js
Normal file
3
scriptapi.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
function script_click_a(url) {
|
||||||
|
window.location.href = url;
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>What is this I don't even.</title>
|
|
||||||
<script type="text/javascript" src="test.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1 id="poke">Sup?</h1>
|
|
||||||
<a href="javascript:analyze();">Click me to analyze the page.</a>
|
|
||||||
<form class="blah">
|
|
||||||
<input id="foo" name="lel" type="text" />
|
|
||||||
<input id="bar" type="submit" />
|
|
||||||
</form>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,17 +0,0 @@
|
|||||||
function analyze() {
|
|
||||||
var all = document.getElementsByTagName("*");
|
|
||||||
for (var i = 0; i < all.length; ++i) {
|
|
||||||
var info = new Array();
|
|
||||||
var validtags = ["A", "BUTTON", "FORM", "IMG", "INPUT", "LINK", "OPTION", "SELECT", "TABLE", "TEXTAREA"];
|
|
||||||
if (validtags.indexOf(all[i].tagName) < 0) continue;
|
|
||||||
info[0] = all[i].tagName;
|
|
||||||
info[1] = all[i].getAttribute("id");
|
|
||||||
info[2] = all[i].getAttribute("name");
|
|
||||||
info[3] = all[i].getAttribute("class");
|
|
||||||
info[4] = all[i].getAttribute("type");
|
|
||||||
dostuff(info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function dostuff(info) {
|
|
||||||
alert(JSON.stringify(info));
|
|
||||||
}
|
|
Reference in New Issue
Block a user