doSimpleXMLHttpRequest, IE and non ascii characters

13 views
Skip to first unread message

Boštjan Jerko

unread,
Apr 16, 2009, 3:30:39 PM4/16/09
to moch...@googlegroups.com
Hi!

I am using MochiKit 1.4 and have a simple usage of
doSimpleXMLHttpRequest:

var handleServerFeedback = function(result)
{
log(d_querystring);

}

var handleServerError = function()
{
log("error");

}

returnedServerValue = new doSimpleXMLHttpRequest("/
showContent/?f_name="+d_querystring);
log(d_querystring);

returnedServerValue
.addCallbacks(handleServerFeedback,handleServerError);


When I use the script on any browser it works perfectly, but when I
set d_querystring with some non standard text characters or non ascii
characters it doesn't work on Internet Explorer - it works in Firefox.

I did a RSS reader and when I have a feed caled: Avian’s Blog it
doesn't work. Mind that there is a ` character in the name. The
problem also appears when I use some Slovene characters (e.g. ccaron -
č).


Any ideas why is this happening?


B.


Bob Ippolito

unread,
Apr 16, 2009, 4:04:10 PM4/16/09
to Boštjan Jerko, moch...@googlegroups.com
You probably need to use encodeURIComponent.

2009/4/16 Boštjan Jerko <ml...@japina.eu>:

Boštjan Jerko

unread,
Apr 16, 2009, 4:13:25 PM4/16/09
to Bob Ippolito, moch...@googlegroups.com
Yes, that does the trick.
I've added encodeURIComponent to d_querystring and voila. Works
everytime.

Thank's for the quick answer.

B.
Reply all
Reply to author
Forward
0 new messages