Window.open does not work in firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hyeewang
    New Member
    • Jun 2014
    • 2

    Window.open does not work in firefox

    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.

    Code:
    $("#button_MN_invite").on("click", function() {
    		var tester = true
    		if ($('#input_MN_invitees_email_ids').val() != "") {
    			//$("#button_MN_invite").unbind("click");
    			$("#button_MN_invite").attr('disabled', 'disabled');
    			emails = $('#input_MN_invitees_email_ids').val().replace(/\s+/g, "");
    			$.each(emails.split(",").slice(0), function(index, item) {
    				if (!MN_emailValidation(item)) {
    					tester = false;
    					//$("#button_MN_invite").bind("click");
    					$("#button_MN_invite").removeAttr('disabled', 'disabled');
    					alert('Check valid Email Address for \'' + item+'\'');
    					return false;
    				};
    			});
    			if (!tester) {
    				//$("#button_MN_invite").bind("click");
    				$("#button_MN_invite").removeAttr('disabled', 'disabled');
    				return false;
    			}
    			//console.log('um not out of function');
    			key = $("#MN_room_key").attr("value");
    			$.ajax({
    				type : "post",
    				url : "http://"+hoster+"/meetnow/inviteToRoom",
    				crossDomain : true,
    				data : {
    					emails : emails,
    					adminemail : $.session.get('roomCrtrMid'),
    					key : key,
    					hangout_id : $("#MN_room_id").attr("value"),
    					roomname : $("#MN_room_name").attr("value"),
    					pleaseuseme : "invite.php",
    					userhost : hoster
    				},
    				beforeSend : function(){
    					$("#loading").show();
    				},
    				complete : function(){
    					$("#loading").hide();
    				},
    				success : function(result) {
    					if (result == "yes") {
    						$("#loading").hide();
    						//alert("Invitation sent successfully.");
    						//window.location = "/meetnow/login.html#" + $("#MN_room_key").attr("value");
    						var newurl = "http://64.34.67.46/meetnow/login.html#"+$("#MN_room_key").attr("value");
    						var [B][I][U]win = window.open(newurl, '_blank'); // not working here [/U][/I][/B]
    					} else if (result == 'no') {
    						$("#loading").hide();
    						//$("#button_MN_invite").bind("click");
    						$("#button_MN_invite").removeAttr('disabled', 'disabled');
    						alert("Programming error, while passing arguments.");
    					} else {
    						$("#loading").hide();
    						//$("#button_MN_invite").bind("click");
    						$("#button_MN_invite").removeAttr('disabled', 'disabled');
    						alert("There was a problem in sending invitation.");
    					}
    				}
    			});
    		[B][I][U]window.open("http://64.34.67.46/meetnow/login.html#"+$("#MN_room_key").attr("value"), '_blank');[/U][/I][/B] // it works well here.
    		
    		} else {
    			//$("#button_MN_invite").bind("click");
    			$("#button_MN_invite").removeAttr('disabled', 'disabled');
    			alert("Please enter Email address and then proceed.");
    		}
    
    	});
    I want window.open() working in the success of Ajax. how to fix it? Thanks.
    Last edited by Rabbit; Jun 17 '14, 05:53 AM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • mHealth
    New Member
    • Jun 2014
    • 13

    #2
    Try something like
    Code:
    
    window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');

    Comment

    • hyeewang
      New Member
      • Jun 2014
      • 2

      #3
      Thanks. mHealth.
      I tried your code.
      window.open('ht tp://www.google.com' , '_blank', 'toolbar=0,loca tion=0,menubar= 0');
      It does not work either.

      Comment

      Working...