From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Yansky
Subject: [jQuery] Retrieve content from element using AJAX?

Is it possible to retrieve specific content from another page, rather
than
the whole page when using AJAX?

-----

Short answer is no, there is no such functionality.  You can however
fudge a few things to make it appear that you are only loading a
fragment.  I had to do something like this recently, so if anyone has a
better way to do this let me know.

http://pastebin.com/897708

Go look at the code and you'll see what I did was pretty basic.  I just
loaded the page (in this example the .load() function entry from the API
docs) into a hidden div, created a reference to that div, and then
pulled out the information I wanted and spit it out via console.log().
You could easily grab the fragment you wanted from the loaded page and
pipe it into your display area as desired using the same technique.

Again, if there's a better way, please let me know as this seemed a
little cumbersome to me but I was unable to figure out a different
method.

-ALEX

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to