Conclusion: It can't be done.

Only workround is to look for "javascript" at the beginning of the
url, and either eval it, or use window.location, depending on the
result.

On Jun 25, 8:07 pm, Nikki Locke <ni...@trumphurst.com> wrote:
> I am devising a test harness for a complex web application. The
> application inserts a javascript file into the HTML it outputs -
> record.js when recording tests, and playback.js when playing them
> back.
>
> Record.js attaches event handlers to all the objects the user might
> interact with (mostly INPUT, SELECT, TEXTAREA, BUTTON and A tags). The
> event handler uses Ajax to send details of the event to a server,
> which saves them to a database.
>
> Playback.js is supposed to query the server to retrieve events, then
> use javascript to play them back.
>
> I've got things mostly working, but I seem to have hit a brick wall
> when it comes to A links. I can't find a way to get the event to
> replay.
>
> I've tried obj.click() and obj.trigger("click"), but neither causes
> the link to be followed.
>
> The hrefs in the links are a mixture of urls and javascript, so I
> can't simply do window.location=obj.attr("href").
>
> Is it just not possible to fire clicks on A links so that the normal
> browser behaviour is emulated?
>
> NikkiLocke

Reply via email to