I am trying to store a variable from my database into a JavaScript variable with the code below:
var long = "<%=RecordSet.record.get('GPS - Longitude')%>";
The <%= and %> are tags local to the API for the program i am using which is based on JavaScript and runs JavaScript. When i call this data field from the database:
If data is stored as: 91° 6' 5" W The data will not store in variable "long" because of the " character in the string.
If data is stored as: 91° 6' 5 W The data will be stored fine in variable "long".
I know there is a .php function called "addslashes()" which is supposed to remedy this issue when pulling information from a database. I have tried using the "replace" function on the database call with no luck. Is this possible within JavaScript?