Is there a way to open a javascript link in IE?

I have a link that uses javascript to submit a form, for example:

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

However, this will point to the vendor-supplied application, which, of course, only works in IE. Is there a way to open this link in IE if the user uses a different browser?

+3
source share
4 answers

Without putting the compiled code on the user machine, more than likely not. This will require you to tell os for a specific program and violate the security restrictions that (and should) be on most browsers on the market today.

, , IE, , . , , .

- , IE, , , , .

, , , WebBrowser, IE.

+10

, . - , Internet Explorer, Mozilla Firefox .

, , IE (, , , IE).

+4

, / . , IE, false. :

<a href="#dummy" onclick="document.some_form.submit()">some link</a>
+1

( ), , , , Internet Explorer , DIV alert(), , Internet Explorer .

- :

<a href="/enablejavascript.html"
    onclick="
        if (window.external && 'undefined' !== typeof window.external.AddFavorite) {
            document.forms['some_form'].submit();
        } else {
            alert('You must be using Internet Explorer to use this website.');
        }
        return false;
    ">some link</a>

window.external.AddFavorite ( ) Internet Explorer, IE . navigator.userAgent MSIE, , Opera, IE.

0

Source: https://habr.com/ru/post/1706040/


All Articles