Following a jQuery ajax call to retrieve an entire XHTML document, what is the best way to select specific elements from the resulting string? Perhaps there is a library or plugin that solves this issue?
jQuery can only select XHTML elements that exist in a string if they're normally allowed in a div in the W3C specification; therefore, I'm curious about selecting things like <title>, <script>, and <style>.
According to the jQuery documentation:
http://docs.jquery.com/Core/jQuery#htmlownerDocument
The HTML string cannot contain elements that are invalid within a div, such as html, head, body, or title elements.
Therefore, since we have established that jQuery does not provide a way to do this, how would I select these elements? As an example, if you can show me how to select the remote page's title, that would be perfect!
Thanks, Pete