php - Function for escaping quotes in javascript? -
this question has reply here:
encode html entities in javascript 8 answersis there function in javascript same htmlentities($string, ent_quotes)
in php? searched lot couldnt find it, recommending regex.
just wanted create sure there no other easier way before seek that
see tutorial
it's 'port' of php's htmlentities function:
function htmlentities(str) { homecoming string(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'); }
javascript php quotes
No comments:
Post a Comment