Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
323 views
in Technique[技术] by (71.8m points)

html - Is there a way to make a javascript link open up in IE?

I have a link that uses javascript to submit a form, like so:

<a href="javascript:document.some_form.submit()">some link</a>

However, this will point to a vendor-supplied application that of course only works in IE. Is there any way to make this link open up in IE if the user is using a different browser?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Without putting compiled code on the user's machine, then more than likely, no. It would require you to specify to the os a specific program to run, and that's going to violate the security restrictions that are (and should) be on most browsers in the market today.

You might be able to create plug-ins for each of the major browser vendors which will intercept the link and open it in IE, but that becomes tedious, as there are different models for each browser. On top of that, you have to get your plugin installed on each machine, which users might not be interested in doing.

The best option here is to inform the user the site must be browsed in IE, and if possible, work with the vendor to make it run in other browsers.

Another possibility is that you might host both your app and the vendor app in a client side program which uses an embedded WebBrowser control, which is essentially, IE.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...