[jQuery] New AJAX plugin - XPath on result?
Hi all
I'm new to JQuery, and would like to use it for advanced features on an
app I've already built. I've been looking at the new AJAX plugin, and
particularly the .load(URI) method. What I'm wondering is whether its
possible to use XPath within JQuery to limit the HTML which is pushed
into the matching element to a single div within the requested page. For
example, if ajax-test.html looks like this:
<html>
<body>
<div id="header">My Page</div>
<div id="content">My content</div>
</body>
</html>
And we use:
$("p").load("/test/ajax-test.html");
to load the document and push to the P element, won't we end up with the
whole html page within the html page we're viewing?
I'd like to be able to use XPath to specify the elements I wish to add.
$("p").load("/test/ajax-test.html", "//div[@id = 'content']/*");
to load the page and push the contents of the #content div to the "p"
element we want to use.
My question is: Is this possible now, and if not will it be possible in
future releases?
--
_*Phillip B Oldham *_
*kilo75 ltd*
a: Round Foundry Media Centre, Foundry St, Leeds, LS11 5QP
t: +44 (0) 870 420 2410
e: phillip.oldham@kilo75.com <mailto:phillip.oldham@kilo75.com>
w: //kilo75.com/ <http://kilo75.com/>
------------------------------------------------------------------------
*Policies*
This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you
in error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them
to anyone.
This e-mail has been created in the knowledge that Internet e-mail
is not a 100% secure communications medium, and we have taken
steps to ensure that this e-mail and attachments are free from any
virus. We must advise that in keeping with good computing practice
the recipient should ensure they are completely virus free, and that
you understand and observe the lack of security when e-mailing us.
------------------------------------------------------------------------
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/