|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problems with sending an encoded url
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? <Kavita.K.Si***@gmail.com> wrote in message
Show quote >news:1157007487.522069.153220@m79g2000cwm.googlegroups.com... Don't use the escape function use encodeURIComponent instead.>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?
Show quote
"Anthony Jones" <A**@yadayadayada.com> wrote in message An alternative worth considering is to post XML instead.news:OkTY7$MzGHA.4308@TK2MSFTNGP03.phx.gbl... > > <Kavita.K.Si***@gmail.com> wrote in message > >news:1157007487.522069.153220@m79g2000cwm.googlegroups.com... > >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. > 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 Thankyou every much Mr Jones :-D
the encodeURIComponent did the trick :) Anthony Jones wrote: Show quote > "Anthony Jones" <A**@yadayadayada.com> wrote in message > news:OkTY7$MzGHA.4308@TK2MSFTNGP03.phx.gbl... > > > > <Kavita.K.Si***@gmail.com> wrote in message > > >news:1157007487.522069.153220@m79g2000cwm.googlegroups.com... > > >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. > > > > 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 |
|||||||||||||||||||||||