开发者

JavaScript inside 'a' href in IE

开发者 https://www.devze.com 2023-03-27 04:40 出处:网络
I would like to use HyperLink of ASP.Net to open a new window when I click on it. I can not hard code the NavigateUrl, instead I have to use \'onclick\' function. In that function I have to use \'wind

I would like to use HyperLink of ASP.Net to open a new window when I click on it. I can not hard code the NavigateUrl, instead I have to use 'onclick' function. In that function I have to use 'window.open(url)'. What should be the value of NavigateUrl in the design page. I could use 'javascript:retur开发者_JAVA技巧n true;' , it works on browsers other than IE. I tried with '#', but it does not give the expected result.


Have you tried javascript:void(0);? Then the a tag looks like:

<a href="javascript:void(0);" onclick="window.open('http://www.stackoverflow.com', 'StackOverflow');">test</a>
0

精彩评论

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