ID:167384
 
I am using a java script code that uses []'s and it is reading as a variable, any suggestions to help me stop this?
Lifehunter wrote:
I am using a java script code that uses []'s and it is reading as a variable, any suggestions to help me stop this?

html = "some_array\[5\] = 7;"
In response to OneFishDown
OneFishDown wrote:
Lifehunter wrote:
I am using a java script code that uses []'s and it is reading as a variable, any suggestions to help me stop this?

> html = "some_array\[5\] = 7;"


Correct way:
html = "some_array\\[5\\] = 7;"


DM will parse the escape, so in order to actually display an escape, you need to escape the escape.
In response to Crashed
Lifehunter probably wants it to only show the [] and not the escape, he was having a problem with it trying to parse his HTML/javascript with embedded variables on a compiler-level, OFD's post was totally correct.
In response to Nadrew
Oh, I see now (made the mistake of not reading the initial post).