Problem with retriving "\" backslash

  • Thread starter balakrishnan.dinesh
  • Start date
B

balakrishnan.dinesh

Hi frnds,

Im having a problem with retriving "\" backslash , In my
javascript client side page , ill get the response from the server side
, the response will contain some url like "\bank\index.htm" .
So what i have to do is, ill get those url and display them in
textfields ,

The problem is , while retriving the url , the backslashes are
missing , for some backslashes its generating junk values like box
shapes things and displaying. So due that i cannot any further
proccess,

Can anyone tell me ,what is the reason behind this and tell me
proper solution for this.

Thanks & Rgrds
Dinesh ...
 
R

Randy Webb

(e-mail address removed) said the following on 11/22/2006 2:30 AM:
Hi frnds,

Im having a problem with retriving "\" backslash ,

That's because it is the escape character in Javascript.

In my javascript client side page , ill get the response from the server side
, the response will contain some url like "\bank\index.htm" .
So what i have to do is, ill get those url and display them in
textfields ,

Simple enough.
The problem is , while retriving the url , the backslashes are
missing , for some backslashes its generating junk values like box
shapes things and displaying. So due that i cannot any further
proccess,
Can anyone tell me ,what is the reason behind this and tell me
proper solution for this.

Have your server either encode the backslash or double them up so that
it sends it as "\\bank\\index.htm" instead of "\bank\index.htm"
 
B

Bart Van der Donck

Im having a problem with retriving "\" backslash , In my
javascript client side page , ill get the response from the server side
, the response will contain some url like "\bank\index.htm" .
So what i have to do is, ill get those url and display them in
textfields ,

The problem is , while retriving the url , the backslashes are
missing , for some backslashes its generating junk values like box
shapes things and displaying. So due that i cannot any further
proccess,

alert('a\bc\d');
// does not display 'a\bc\d', since \b refers to the ASCII backspace
// control character (dec/hex 8), and '\d' becomes 'd' since '\' is a
// useless escape sequence here (you don't need to escape 'd').
// You probably want:
alert('a\\bc\\d');
// or
alert('a\u005Cbc\u005Cd');
// or
alert('a\x5Cbc\x5Cd');

Hope this helps,
 

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,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top