Ajax, content-type header and python -


when using python web opposed php, have manually write header: content-type:text/html.

if want change inner html of element ajax, should python script (requested ajax) output above header or plain html response?

every http response must include content-type header. php happens insert 1 default. whatever python library using apparently doesn't. therefore need provide 1 explicitly.

this leaves question "should fragment of html served text/html?"

the rfc says:

the text/html media type defined w3c recommendations; latest published version [html401]. in addition, [xhtml1] defines profile of use of xhtml compatible html 4.01 , may labeled text/html.

these specifications not define html fragments, should use like:

content-type: x-text/html-fragment 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -