开发者

Jquery hyperlinks triggering

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

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

There 开发者_JAVA百科is any alternative to window.location??

Thanks

Luca


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜