Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invalid character in firefox??

Status
Not open for further replies.

jrenae

Programmer
Jan 18, 2006
142
US
Hello,

I'm fairly new to ajax, and quite new to having to code to firefox. I have an aspx page that sends ajax requests to the server and works just fine in IE. However, when I get the response back from firefox, the error console tells me that it is not well-formed (I'll mention that I'm getting responseText back NOT responseHTML for reasons I won't go into). The response string is:
Audi=A3~A4~A5~A6~A8~Q7~R8~RS 4~S4~S5~S6~S8~TT

I suspect that it's the equal sign that it doesn't like as indicated by error message.

So the question is: Must I change my response text, or is there a way to get around it, and also, if the equal sign is truly not well-formed, is there a good reference for characters that are 'acceptable' for firefox ajax responseText?

I'm using a the "GET" method when sending the response and the request header:
Code:
setRequestHeader("Content-Type","application/json; charset=utf-8");

Thanks
 
Not to mention that if you're setting the request header as application/json, this data:
Code:
Audi=A3~A4~A5~A6~A8~Q7~R8~RS 4~S4~S5~S6~S8~TT
is not a JSON-encoded array. You should have something like this returning:
Code:
{"audi":["A3","A4","A5","A6","A8","Q7","R8","RS 4","S4","S5","S6","S8","TT"]}

something like that anyways.

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top