By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

Window.open does not work in firefox

P: 2
I am working with Firefox. Why window.open() does not work with Ajax? How to fix it? But,it works without Ajax. Please see the code underlined.

Please see the code below.

Expand|Select|Wrap|Line Numbers
  1. $("#button_MN_invite").on("click", function() {
  2.         var tester = true
  3.         if ($('#input_MN_invitees_email_ids').val() != "") {
  4.             //$("#button_MN_invite").unbind("click");
  5.             $("#button_MN_invite").attr('disabled', 'disabled');
  6.             emails = $('#input_MN_invitees_email_ids').val().replace(/\s+/g, "");
  7.             $.each(emails.split(",").slice(0), function(index, item) {
  8.                 if (!MN_emailValidation(item)) {
  9.                     tester = false;
  10.                     //$("#button_MN_invite").bind("click");
  11.                     $("#button_MN_invite").removeAttr('disabled', 'disabled');
  12.                     alert('Check valid Email Address for \'' + item+'\'');
  13.                     return false;
  14.                 };
  15.             });
  16.             if (!tester) {
  17.                 //$("#button_MN_invite").bind("click");
  18.                 $("#button_MN_invite").removeAttr('disabled', 'disabled');
  19.                 return false;
  20.             }
  21.             //console.log('um not out of function');
  22.             key = $("#MN_room_key").attr("value");
  23.             $.ajax({
  24.                 type : "post",
  25.                 url : "http://"+hoster+"/meetnow/inviteToRoom",
  26.                 crossDomain : true,
  27.                 data : {
  28.                     emails : emails,
  29.                     adminemail : $.session.get('roomCrtrMid'),
  30.                     key : key,
  31.                     hangout_id : $("#MN_room_id").attr("value"),
  32.                     roomname : $("#MN_room_name").attr("value"),
  33.                     pleaseuseme : "invite.php",
  34.                     userhost : hoster
  35.                 },
  36.                 beforeSend : function(){
  37.                     $("#loading").show();
  38.                 },
  39.                 complete : function(){
  40.                     $("#loading").hide();
  41.                 },
  42.                 success : function(result) {
  43.                     if (result == "yes") {
  44.                         $("#loading").hide();
  45.                         //alert("Invitation sent successfully.");
  46.                         //window.location = "/meetnow/login.html#" + $("#MN_room_key").attr("value");
  47.                         var newurl = "http://64.34.67.46/meetnow/login.html#"+$("#MN_room_key").attr("value");
  48.                         var win = window.open(newurl, '_blank'); // not working here 
  49.                     } else if (result == 'no') {
  50.                         $("#loading").hide();
  51.                         //$("#button_MN_invite").bind("click");
  52.                         $("#button_MN_invite").removeAttr('disabled', 'disabled');
  53.                         alert("Programming error, while passing arguments.");
  54.                     } else {
  55.                         $("#loading").hide();
  56.                         //$("#button_MN_invite").bind("click");
  57.                         $("#button_MN_invite").removeAttr('disabled', 'disabled');
  58.                         alert("There was a problem in sending invitation.");
  59.                     }
  60.                 }
  61.             });
  62.         window.open("http://64.34.67.46/meetnow/login.html#"+$("#MN_room_key").attr("value"), '_blank'); // it works well here.
  63.  
  64.         } else {
  65.             //$("#button_MN_invite").bind("click");
  66.             $("#button_MN_invite").removeAttr('disabled', 'disabled');
  67.             alert("Please enter Email address and then proceed.");
  68.         }
  69.  
  70.     });
I want window.open() working in the success of Ajax. how to fix it? Thanks.
Jun 16 '14 #1
Share this Question
Share on Google+
2 Replies


P: 13
Try something like
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');
  4.  
Jun 17 '14 #2

P: 2
Thanks. mHealth.
I tried your code.
window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');
It does not work either.
Jun 17 '14 #3

Post your reply

Sign in to post your reply or Sign up for a free account.