Jump to content

Passing variables to javascript


bcamp1973

Recommended Posts

I want to pass variables (primarily text strings) to a couple javascript functions. However, there are several characters that javascript gets hung up on including parenthesis, commas, double and single quotes etc. What all do i need to escape beyond that? also, what's the best method for escaping these characters? str_replace() seems a bit cumbersome...is there something more efficient?

Link to comment
https://forums.phpfreaks.com/topic/10976-passing-variables-to-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.