Java Reference
In-Depth Information
form.submit();
}
//-->
</script>
This is a very simple form checker. This form checker validates that the user has entered
a value for each of the three fields. If all fields have been entered, then the form is submit-
ted.
Processing JavaScript forms is usually fairly easy for a bot. A JavaScript validation form
often works just like a regular form. Your bot can usually ignore the validations and just post
the form as a normal form would be posted. Recipe 9.3 shows how to write a bot for this
page.
Working with AJAX
AJAX is a relatively new technique used by many web sites. It uses JavaScript and XML
to exchange data with the web server. AJAX stands for “Asynchronous JavaScript and XML”.
This allows the web site to interact with a user without moving to a new page. Many AJAX
web sites more closely resemble traditional GUI applications than web sites.
AJAX is heavily dependent on JavaScript. Special considerations must be made for web
sites that make use of AJAX. Chapter 10 will show you how to create bots for AJAX sites.
Other JavaScript Techniques
This chapter discusses some of the most common JavaScript techniques. However, this is
only the beginning. Web sites make use of JavaScript in many different ways. JavaScript sites
are much more complex for bots than non-JavaScript sites. There is no one single method to
create a bot for all JavaScript sites.
Creating bots for JavaScript sites means that you, the bot programmer, must understand
how these JavaScript sites work and generate the correct HTTP requests and process the
responses. It is important to remember that generating the correct HTTP requests is really
all there is to creating a bot.
After all, the web server is not aware of JavaScript. JavaScript simply helps the browser to
generate HTTP requests. Your bot can generate these same requests, if you understand how
the site is using JavaScript. Also, there are many good topics and online tutorials for learning
JavaScript.
Search WWH ::




Custom Search