Passing + sign to via XML to server side request

  • Thread starter Thread starter Jim M
  • Start date Start date
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
 
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.
 
Back
Top