php - Sending json string along with html data in ajax response text - How to? -


for small amounts of textual info ( control messages ) send call bullets (same syntax html comments ) along page during ajax calls. example

<!--control message--><html> page here</html> 

i parse "bullet" out before rendering page...even though don't have to.

for more data, 5 variables, plan on json_encoding it...and sending page well.

how others demarcating , extracting structured data / json strings html. put in "bullet" below , extract out...but guess there more "proper" way this.

<!--json string here--><html> page here</html> 

if data contextual html, send them data tags within html?

<html data-value="{name:value}">     <body>         <div data-div="{name:value}">     </body> </html> 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -