Problems with sending an encoded url

K

Kavita.K.Singh

Hello Gurus
thankyou for your help in advance :)......heres my problem

var vAppPath=(my file)
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("POST",vAppPath,false);
xmlHttp.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
xmlHttp.send("text=" +
escape(document.getElementById("tledit").value));

were document.getElementById("tledit").value = assccéccèccÉcc
d'abonnccàcc ccÀcc ccboccîccte

now in my file.....i do try to read the text
text = request("text")

the text = asscccccccc d'abonncccc cccc ccboccccte

the french characters are stripped out. I think its the escape
functions thats doing this.
is there a way to over come this?
 
A

Anthony Jones

Hello Gurus
thankyou for your help in advance :)......heres my problem

var vAppPath=(my file)
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("POST",vAppPath,false);
xmlHttp.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
xmlHttp.send("text=" +
escape(document.getElementById("tledit").value));

were document.getElementById("tledit").value = assccéccèccÉcc
d'abonnccàcc ccÀcc ccboccîccte

now in my file.....i do try to read the text
text = request("text")

the text = asscccccccc d'abonncccc cccc ccboccccte

the french characters are stripped out. I think its the escape
functions thats doing this.
is there a way to over come this?

Don't use the escape function use encodeURIComponent instead.
 
A

Anthony Jones

Anthony Jones said:
Don't use the escape function use encodeURIComponent instead.

An alternative worth considering is to post XML instead.

Change the client code:-

var vAppPath=(my file)
var domReq = new ActiveXObject("Microsoft.XMLDOM")
domReq.appendChild(domReq.createElement("text")).text =
document.getElementByID("tledit").value
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("POST",vAppPath,false);
xmlHttp.setRequestHeader("Content-Type","text/xml");
xmlHttp.send domReq


Now on the Server:-

Dim domReq: Set domReq = Server.CreateObject("MSXML2.DOMDocument.3.0")
domReq.async = false
domReq.load Request

text = domReq.documentElement.text
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top