0

I am using bellow code. It seems works fine in firefox and IE But not in Crome browser for skip popup blocking.

new Ajax.Request('<?php echo $this->getUrl('custom/index/addcountry') ?>', {
    asynchronous: false,
    method: 'post',
    parameters: str,
    onSuccess: function(respo) {
        window.open(respo.responseText,'_blank' );
    }
});

In Crome browser popup block how to skip popup blocking.

1

I didn't tested it but try this:

var redirectWindow = window.open('some url', '_blank' );
new Ajax.Request('<?php echo $this->getUrl('custom/index/addcountry') ?>', {
       asynchronous: false,
       method: 'post',
       parameters: str,
       onSuccess: function(respo) {
           redirectWindow.location;
       }
});

JSFIDDLE Demo

  • Thanks for your answer but this not works for me. i got redirect url from ajax responce. – denish vachhani Sep 20 '17 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.