开发者

How to programmatically click on a EIT Lightbox hyperling in asp.net

开发者 https://www.devze.com 2022-12-24 05:20 出处:网络
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

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.

0

精彩评论

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