CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   Jquery.Post() question. (http://www.codingforums.com/showthread.php?t=285040)

Ax3l 12-30-2012 09:51 PM

Jquery.Post() question.
 
Is there a way I can use jquery.post() to only add select content from a different page? Or is that beyond it's scope?

DanInMa 12-31-2012 02:14 AM

like from a specific element from a resulting page? when you specify the url also include an element id and you can get content from jsut the element with that id


example url: "/mypages/mypage.php #myelement"

Ax3l 12-31-2012 06:05 PM

Quote:

Originally Posted by DanInMa (Post 1303157)
like from a specific element from a resulting page? when you specify the url also include an element id and you can get content from jsut the element with that id


example url: "/mypages/mypage.php #myelement"

How would that look in context?
Code:

alreadyloading = false;
nextpage = 2;
 
$(window).scroll(function() {
    if ($('body').height() <= ($(window).height() + $(window).scrollTop())) {
        if (alreadyloading == false) {
            var url = "page"+nextpage+".html";
            alreadyloading = true;
            $.post(url, function(data) {
                $('#galleryThumbsCol').children().last().after(data);
                alreadyloading = false;
                nextpage++;
            });
        }
    }
});



All times are GMT +1. The time now is 02:21 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.