Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-30-2012, 09:51 PM   PM User | #1
Ax3l
New Coder

 
Join Date: Aug 2012
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Ax3l is an unknown quantity at this point
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?
Ax3l is offline   Reply With Quote
Old 12-31-2012, 02:14 AM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
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"
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 12-31-2012, 06:05 PM   PM User | #3
Ax3l
New Coder

 
Join Date: Aug 2012
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Ax3l is an unknown quantity at this point
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++;
            });
        }
    }
});
Ax3l is offline   Reply With Quote
Reply

Bookmarks

Tags
content, javascript, jquery, post

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:00 PM.


Advertisement
Log in to turn off these ads.