0
<a href="myuglypage.php">click</a>

Does JQuery allow you to trigger a link event without actually clicking on "click"??

There is any alternative to window.location??

Thanks

Luca

1
  • I'm not sure I understand, is the click() method not doing what you want? Apr 4, 2011 at 15:21

2 Answers 2

1

In short, no.

You break the back button, HTTP Referer is not populated etc. You will also have to manually use jQuery to listen for the click event and then do the relocation. Just triggering a click event on the anchor will not simulate clicking the link.

So yes, you're essentially stuck using an event handler and window.location.

Some more in-depth discussion here: jQuery Click Trigger

0

I think you can use this

window.location.href = "myuglypage.php";

This is diffrent from window.location.replace() method. It i more similer to clicking the link.

1
  • Really doesn't answer his question if you ask me.
    – JackWilson
    Apr 4, 2011 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.