Creating valid XHTML when using jQuery .append()
In the examples here: http://api.jquery.com/append/ they show straight HTML being used as an argument:
$('.inner').append('<p>Test</p>');
But the validator at W3 will object to this like so
Line 96, column 76: document type does not allow element "p" here
…ata).append("<p class='pag
How should I do this to get valid XHTML?
EDIT - Here is an example of what is written by PHP:
$('#citations_18401-01').html(data).append("开发者_JS百科<p class='paginated_link'><b>Result Pages:</b> <b class='paginated_link'>1</b> <a class='paginated_link' href='property_info.php?lot=18401-01"e_set=1&limit=30&tab=3'>2</a> </p><p> </p>");
You have to wrap your inline jQuery with special tags for XHTML. See this article.
精彩评论