Jump to content

Javascript var with a slash char in it


Ed_P

Recommended Posts

I'm trying to create a simple variable with a value that contains a "\" but the "\" is an escape character in Javascript so how do I do this? :P For example VAR x = "images\test\new.gif"This gives me an error. If I use %5C for the slash it doesn't convert to \. I can't believe I haven't encountered this before but if I did I've forgotten how to resolve it. :) Thanks

Link to comment
Share on other sites

Yup!! That did it epp_b. Thanks :thumbsup: I use the \n and \t to format alerts and I know there are others. I thought I had tried the \\ option and it didn't work but apparently not. Thanks again. :huh:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...