Alternatives to innerHTML for use with a Quote link on a forum
I'm looking for a Alternatives to innerHTML what I can use on my forum system.
You can see in the code, what I'm using now.
Because I read a lot of negative response to innerHTML on the WWW, and it's not working when $quote3[post] contain a: " , ` '" " or other characters like that, I wanted to ask if you could help me with a better way of doing this.
Removing the , and ' is not a option, because the weird post you would get.
Tomarse111
The above may not work, as I'm not a PHP programmer, as was pure guess work. Also, I'm not suggesting you remove the characters, I'm saying they need escaping, which would allow you to use value or innerHTML to your hearts content (There is nothing wrong with innerHTML as is faster than other w3c DOM methods).
Lol, why not do you have an allergy? There's a stereotype against frames because of search engine issue but they can be navigated and in the end they don't have any affect at all on search engines.
I'm not looking for a frame system. But for a way to get my quote link working....
Tomarse111
As i said above, you simply need to escape the unsafe JS characters in your PHP output, then use the script below. You certainly don't need to start using frames.
As i said above as well, my background is not from PHP, it's coldfusion. In CF we have a function called JSStringFormat which makes a string safe i.e. it basically replaces all unsafe chars with \ in front of them to escape them.
This is the sort of function you need in PHP. While looking around I have found:
Open in new window