Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-30-2011, 11:19 PM   PM User | #1
miranda
Senior Coder

 
Join Date: Dec 2002
Location: Arlington, Texas USA
Posts: 1,062
Thanks: 4
Thanked 8 Times in 8 Posts
miranda is an unknown quantity at this point
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; 06-30-2011 at 11:27 PM..
miranda is offline   Reply With Quote
Old 07-01-2011, 06:54 AM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
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
devnull69 is offline   Reply With Quote
Users who have thanked devnull69 for this post:
miranda (07-01-2011)
Old 07-01-2011, 02:45 PM   PM User | #3
miranda
Senior Coder

 
Join Date: Dec 2002
Location: Arlington, Texas USA
Posts: 1,062
Thanks: 4
Thanked 8 Times in 8 Posts
miranda is an unknown quantity at this point
Thumbs up



Sheesh. Talk about dumb. I never even noticed that I forgot to include the .innerHTML
miranda is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:25 AM.


Advertisement
Log in to turn off these ads.