user1260827
user1260827

Reputation: 1520

Download file, open new tab in browser

After some actions on my site user can donwload file. First, I ask user: "Would you like to download file". This is modal dialog created with fancybox. There are buttons: Yes and No. When user clicks "Yes" I want to open new tab in browser and show standart save file dialog. I have this code:

$(document).on('click', '#agentAcceptSave', function () {
        alert(1);
        window.open = '/ticket?orderId=' + $('#agentOrderId').val();
} 

But, new tab not open and url not calls, but alert is showed. Where is a error?

Upvotes: 12

Views: 28812

Answers (1)

mohammed momn
mohammed momn

Reputation: 3210

I tried this code and it worked for me:

$(document).on('click', '#download', function() {  
    window.open('http://www.google.com');    
});

Upvotes: 12

Related Questions