Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts

    invalid assignment left-hand side

    I have a script that returns the following error in firefox
    invalid assignment left-hand side

    In the code I am working in a child window and making the ajax call. I want to perform the task and then load the parent window with the new info and close the child window once that is done. In the past I would have just had a single ajax call and then use window.opener.location.reload(); However, this sends a message to the user telling them they need to resend the data which is annoying to the users.


    here is the code the purple colored line is the one that firebug points to
    Code:
    function MoveToFolder(App,fldr,VJ,VL,VF,Rid){
    	var xmlHttp;
    	if (navigator.userAgent.indexOf("MSIE")>=0){
    		var strName="Msxml2.XMLHTTP";
    		if (navigator.appVersion.indexOf("MSIE 5.5")>=0){
    			strName="Microsoft.XMLHTTP";
    		}
    		try{
    			xmlHttp = new ActiveXObject(strName);
    		}
    		catch(e){
    			//alert("Error. Scripting for ActiveX might be disabled")
    			return e
    		}
    	}
    	else if(window.XMLHttpRequest){
    		xmlHttp = new XMLHttpRequest();
    	}
    	var url="/admin/ajax/MoveFolder.asp";
    	var params = "ApplicationID=" + App + "&folderID=" + fldr;
    	xmlHttp.open("POST", url , true);
    	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    	xmlHttp.onreadystatechange = function() {  
    		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
    			var url="/admin/ajax/FillApplicantList.asp";
    			var params = "CPType=L&JobID=" + VJ + "&folderID=" + VF + "&LocationID=" + VL+ "&RoleID=" + Rid;
    			xmlHttp.open("POST", url , true);
    			xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    			xmlHttp.onreadystatechange = function() {  
    				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
    					window.opener.document.getElementById("applicantList") = xmlHttp.responseText;					window.close();
    				}
    			}
    			xmlHttp.send(params)
    		}
    	}
    	xmlHttp.send(params)	
    }
    Last edited by miranda; 07-01-2011 at 12:27 AM.

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    You are trying to assign a string to a DOM element ... maybe this is what you really wanted to do
    Code:
    window.opener.document.getElementById("applicantList").innerHTML = xmlHttp.responseText;
    i.e. assign a string to the innerHTML of a DOM element

  • Users who have thanked devnull69 for this post:

    miranda (07-01-2011)

  • #3
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts

    Thumbs up



    Sheesh. Talk about dumb. I never even noticed that I forgot to include the .innerHTML


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •