0

I am trying to store some HTML created by users with TinyMCE .I am using JQuery AJAX POST to post content to other page . What happens is HTML is having   or & than it treats content after that as a new parameter so only content before that '&' is stored to database.Do I have to escape it before posting ?If so how ?

0

3 Answers 3

1

I would never save HTML in a database. HTML is presentation; relational databases are for persistence. Save the data and format it as HTML. Keep the two layers separate.

Sign up to request clarification or add additional context in comments.

2 Comments

What if there is some application where user can have their own htm content?There is no predefined template in this case.
Wordpress or any other CMS? It is quite justified in certain situations.
0

the data must be stored in a database and the layout (html) in a webform or related. Retrieve the data when needed and add the html code in the page itself

Comments

0

Whoopse .... escape() worked for me .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.