'Saving html code to a database if the font family has double quotes?
I do a simple text editor. With the javascript select option I add font-family to innline-style and change the font-family style. After that I need to ajax-save the html in the mysql database.
If font-family doesn't have duplicate quotes like Arial, then html is saved in the database normally, but if it has duplicate quotes, in the database it is not saved to the end, the html is saved to the font-family:
I noticed quotes in the font-family: & quot; Times New Roman & quot ;;
How do I enable saving html code to a database if the font family has double quotes?
After saving to the database if there are no duplicate quotes:
<div id="child" class="child" style="width: 100px; height: 50px; color: rgb(0, 0, 0); font-family: Arial; font-size: 16px;"></div>
After saving to the database if it has double quotes ( font-family:"Times New Roman"; ):
<div id="child" class="child" style="width: 100px; height: 50px; color: rgb(0, 0, 0); font-family:
Solution 1:[1]
A commonly used entity in HTML is the double quotation mark:
HTML Character Entities must replace before ajax. Solution.., simple & quot replace;
.replace("& quot","");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | borma |