[RESOLVED] Place backslashes into a newly created javascript file
Hi all,
First, I know that this is partially a PHP code, however; the portion that I need help with is Javascript so I decided to put it in the javascript category. This code takes the text contained in $code5 and puts it in a .js file. The problem is that when the text in $code5 is placed in the .js file, the backslashes (\) before the quotes (") are deleted. I need these backslashes to remain when the code is placed in the . js file. I tried adding a second backslash next to each backslah to see if that would work, but it didn't. any help would be greatly appreciated.
hi, thanks for your reply. I tried what you suggested and unfortunately it doesn't work with the code I have. Is there any way to leave it like it is with the double quotes? Thanks so much!
When you wrap variables in single quotes, they are not evaluated like they are when enclosed in double quotes, so you have to concatenate the variables.
Thanks for your continued help. Unfortunately I need it to look exactly as it does below (except to replace the variables with their values). I need all the double quotes and backslashes to be exactly as they when they are transfered to the .js file. Thanks so much
Bookmarks