How to programmatically click on a EIT Lightbox hyperling in asp.net
On my webpage Im using EIT Lightbox to display images. I need to click on the Lightbox hyper link by code. I have tri开发者_Python百科ed the following
body.Attributes.Add("onLoad", "document.getElementById(\"lbh1\").click()\n");
body.Attributes.Add("onload", "eval(document.getElementById(\"lbh1\").href);\n");
But neither seems to work. If I use the following code
body.Attributes.Add("onload", "alert('popup');\n");
The alert is displayed
Is there another way to do the click?
I'm guessing this doesn't work in Firefox. Check out this article: http://lifescaler.com/2008/04/simulating-mouse-clicks-in-javascript/ or just do a Google search on simulating mouse events and/or clicks.
精彩评论