Please see my comment to the question: it's not clear why would you try to approach the problem like that.
Let's concentrate on having a local HTML page (no server side at all; or, more exactly, having server side is irrelevant) with Javascript sending the request. All you frames and other things are totally irrelevant. The "submission" simply means that you merely should send appropriate HTTP request. With Java, it is done using Ajax, and the most convenient way of doing so would be using jQuery
.Ajax()
:
http://en.wikipedia.org/wiki/Ajax_(programming)[
^],
http://api.jquery.com/jquery.ajax[
^].
More serious problem is: how to know what exactly to send, in what form? First of all, from your question, I can assume that you have some "manual", "non-automatic" way of posting the ad, most likely on the site supporting those ads (where else?). So, learn what this submit page does. It can also do it using Ajax, or using just the HTML form. You need to see at the source code of that HTML page, perhaps also download relevant scripts, and see what it does.
But I have a different idea: you can skip all the intermediate steps (getting and transforming data, whatever it is, an so on) and get directly to the HTTP request. For that purpose, download and use one of the available HTTP spy applications. Typically, such applications are implemented as plug-ins for some existing browser. I, for example, use HttpFox, a plug-in for the Mozilla browsers, but you can use anything else. Activate such application in the browser (start tracking HTTP packages) and then perform manual submission. When it all done, look at all the sent HTTP requests and received HTTP responses. Understand what is sent; experiment a bit with different submissions to catch the pattern. Do exactly the same in your own Javascript. This simple technique nearly always helped me to do some
Web scraping even in pretty tricky situations.
—SA