开发者

opening the link only in IE browsers [duplicate]

开发者 https://www.devze.com 2023-03-02 17:57 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: how to restrict users to open the email link only in IE or Mozilla
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

how to restrict users to open the email link only in IE or Mozilla

Hi, i am sending an mail link like this:

http://localhost/abc/RFalse&format&retururl=/abc/Reports/main.aspx&mailid=surya

开发者_运维百科

from my application to an user,is there any way that i can make sure or check so that this link can only be opened in IE browser,

Condition

when they user try to opening in any other browser it should give an alert message telling him to open in IE browser only.

any help would be great, hope my Question is clear

thanks Kumar


The question is clear. the answer is: not possible.

Change the link to a page where there is a conditional code to show a link or not.

Here is the code on the page you mail the link to

<!--[if IE]>
<a href="real_link_for_ie_users.html">You have a browser I have decided to support</a>
<![endif]-->
<![if !IE]>
I apologise, but for some reason you are using a browser that I have decided not to support
<![endif]>


Well, you could check the user-agent on the server-side or via JavaScript and display a corresponding message. But I wouldn't recommend to do that. Better make the page work with "real" browsers instead.


This is completely possible, but bad practice. You should use Web Standards to ensure it works in any browser.

However, if you must, add this JavaScript code to your page:

if (navigator.appName!='Internet Explorer') { alert('This website can only be viewed with Internet Explorer'); history.go(-1); }

Be warned, however, that this will only work if JavaScript is enabled.

0

精彩评论

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

关注公众号