dianikol85 Posted April 5, 2011 Report Posted April 5, 2011 Hi, i have a link in the php file which i want it to get clicked when the page has been load. I am using jquery. look the code $(document).ready(function(){ $("#pdf").trigger('click'); }); and this link <a href="http://www.google.com" id="pdf">Google</a> Any suggestions? Quote
falkencreative Posted April 5, 2011 Report Posted April 5, 2011 I looked into this just recently, and really didn't find a clean solution. I'm pretty sure the code you posted above won't work the way you anticipate -- you also need a section like this: $('#pdf').click(function(){ ...code here... }); One way around it that I found, though, is using jquery to parse the link, return the href value, and use window.location to change the page. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.