Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
185
rated 0 times [  188] [ 3]  / answers: 1 / hits: 27643  / 12 Years ago, fri, november 9, 2012, 12:00:00

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?


More From » jquery

 Answers
134

I tried this code and it worked for me:



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

[#82090] Wednesday, November 7, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kristinsonjab

Total Points: 364
Total Questions: 98
Total Answers: 98

Location: Christmas Island
Member since Mon, Oct 19, 2020
4 Years ago
kristinsonjab questions
Fri, Mar 4, 22, 00:00, 2 Years ago
Fri, Jan 22, 21, 00:00, 3 Years ago
Fri, Aug 14, 20, 00:00, 4 Years ago
;