有没有办法在IE中打开JavaScript链接? [英] Is there a way to make a javascript link open up in IE?

查看:117
本文介绍了有没有办法在IE中打开JavaScript链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用javascript提交表单的链接,如下所示:

 < a href =javascript: document.some_form.submit()>一些链接< / a> 

但是,这将指向供应商提供的应用程序,当然只能在IE中使用。如果用户使用不同的浏览器,是否有任何方法可以在IE中打开这个链接?解析方案

没有编译代码在用户的机器上,那么很可能,不。它会要求你指定一个特定的程序来运行,这将违反现在市场上大多数浏览器的安全限制。



您可以为每个主要浏览器供应商创建插件,这些插件会拦截链接并在IE中打开它,但这会变得单调乏味,因为每个浏览器都有不同的模型。最重要的是,你必须让你的插件安装在每台机器上,用户可能不感兴趣。



这里最好的选择是告诉用户网站必须在IE中浏览,如果可能的话,与供应商合作,使其在其他浏览器中运行。



另一种可能是您可能同时托管您的应用程序和供应商应用程序在客户端程序中使用嵌入式WebBrowser控件,这本质上就是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?

解决方案

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.

这篇关于有没有办法在IE中打开JavaScript链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆