Passing + sign to via XML to server side request

J

Jim M

I am using javascript to build XML and pass it to the .Net Server Side VB
Script page.

So I build the XML string as follows in javascript...

xml_string = "<tagname>" + escape(var_to_pass) + "</tagname>"

On the server I use httputility.urldecode(hidden_xml_string.value) to decode
the XML.

The problem is that the "+" sign is converted to nothing.

I found that I can use encodeURIComponent() on the client in the javascript,
and things work OK, but...

Is there a way to do the same thing using escape()?

Thanks in advance.

Jim
 
M

Martin Honnen

Jim said:
I am using javascript to build XML and pass it to the .Net Server Side VB
Script page.

So I build the XML string as follows in javascript...

xml_string = "<tagname>" + escape(var_to_pass) + "</tagname>"

On the server I use httputility.urldecode(hidden_xml_string.value) to decode
the XML.

The problem is that the "+" sign is converted to nothing.

I found that I can use encodeURIComponent() on the client in the javascript,
and things work OK, but...

Is there a way to do the same thing using escape()?

Why does the unescaped + hurt you inside of some XML element's content?
I don't see why that is a problem.
 

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

Top