Discussion:
doSimpleXMLHttpRequest, IE and non ascii characters
Boštjan Jerko
2009-04-16 19:30:39 UTC
Permalink
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.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---
Bob Ippolito
2009-04-16 20:04:10 UTC
Permalink
You probably need to use encodeURIComponent.
Post by Boštjan Jerko
Hi!
I am using MochiKit 1.4 and have a simple usage of
        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.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---
Boštjan Jerko
2009-04-16 20:13:25 UTC
Permalink
Yes, that does the trick.
I've added encodeURIComponent to d_querystring and voila. Works
everytime.

Thank's for the quick answer.

B.
Post by Bob Ippolito
You probably need to use encodeURIComponent.
Post by Boštjan Jerko
Hi!
I am using MochiKit 1.4 and have a simple usage of
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.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...