开发者

JavaScript inside 'a' href in IE

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜