Java Reference
In-Depth Information
{
if (target == "_top")
window.top.location.href = url;
else if (target.substr(0,1) != "_")
window.parent.frames[target].location.href = url;
else window.location.href = url;
}
else
{
window.location.href = url;
}
}
menu.selectedIndex = 0;
}
</script>
Describing how this JavaScript functions, is beyond the scope of the topic. Entire topics
have been written on JavaScript programming. However, you can see near the bottom, that
the code moves the browser to the link specified in the <option> tag by the following line
of code:
window.location.href = url;
The window.location.href property allows JavaScript to move the browser to
a new page. This is often the line of code that a bot programmer is most interested in. Recipe
9.1 shows how to parse the JavaScript and access all pages in this article.
Working with JavaScript Includes
Not all JavaScript is necessarily located on the page that is making use of it. “JavaScript
includes” allow an HTML form to import JavaScript from an external file. This allows com-
monly used JavaScript code to be placed into files, making them easily accessible across
many HTML documents.
To see an example of “JavaScript includes”, examine the following URL:
http://www.httprecipes.com/1/9/includes.php
You can also view this page in Figure 9.2.
Search WWH ::




Custom Search