开发者

jQuery, Proper context for window.open

开发者 https://www.devze.com 2023-01-10 04:51 出处:网络
I am trying to load a web page in a new window on class=\"link\" Below is what I have but it does not seem to work in IE 7-8

I am trying to load a web page in a new window on class="link" Below is what I have but it does not seem to work in IE 7-8

    $('.clicky').mousedown(function(){
        window.open开发者_如何转开发("http://google.com");
    });​

Here is the complete context http://jsfiddle.net/Zw5c2/14/

Foolish me it was my pop up blocker. But I modified the script to open in the same window

        $('.link').mousedown(function() {
            window.location="http://google.com";
        });​


Your browser is probably blocking popups. You can try to use the .click() event instead or add a "normal" anchor tag with the url as href.


Works in IE6/7/8 for me, ran then on virtual boxes.

I believe your popups are indeed disabled.

check your settings if the browser doens't ask to allow popups.

0

精彩评论

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