Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2012
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    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"

  • #3
    New Coder
    Join Date
    Aug 2012
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by DanInMa View Post
    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++;
                });
            }
        }
    });


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •