Results 1 to 2 of 2

Thread: special inline characters - javascript

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2001
    Location
    Ireland
    Posts
    47

    special inline characters - javascript

    Hi all,

    I have a session variable that contains the following string "europe\bmaher" , when I use an alert to display this the '\b' in the string is interpreted as a special inline char ie. backspace. I've tried using the string.replace() function to replace the \ with a \\ and it still doesn't work. Does anyone know how to display the string without any interpretation ??

    Thanks

  2. #2
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    Instead of replacing "\" with "\\", try replacing "\b" with "\\b".

    I'm sure there are other ways, so check the sig.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width