javascript - convert quotation marks into HTML codes in large text -


i creating application in html, css, jquery mobile, having big text. text, have copy resource , in text editor fine. (they "this double quotes",'this single quotes'). in browser quotation marks become รข€™ , because text big, can't go changing each mark ".

so how can convert quotation marks in such big text html codes how supposed in browser?

first, find quotations marks can appear in text. than, foreach quotation marks, example single quote ', replace \':

var initialtext = document.getelementbyid("text").innerhtml;  var finaltext = str.replace(initialtext, "\'"); finaltext = str.replace(finaltext, '\"'); 

finally use variable "finaltext". notice first replace variable "initialtext", after first iteration replace variable "finaltext"


Comments