0

hi all.. i'm trying to get the next page content inside the <ol> tag to append within the current page <ol> tag... given below is the jquery i'm using... when i use alert "next_page" its showing the next page's link..
but its not loading the next page content in the current page...

<script type="text/javascript">
jQuery(".paging div a").live('click', function(e) {
    e.preventDefault();
    var next_page = jQuery(this).attr('href');
    //alert(next_page);
      jQuery.get(next_page, function(data) {
     var $response = jQuery(data);
     var more_div = $response.find('.job').html();

    jQuery('</ol>').hide()
               .append(more_div)
               .appendTo('.job')
               .delay(100)
               .slideDown('slow')
    jQuery('.paging').not(':last').hide();
});
//alert($response);
});
jQuery('.paging div a').live('click', function(e) {
    e.preventDefault();
    if (jQuery('.job').length != 1) {
        jQuery('.job').last().remove();
    } 
    jQuery('.paging').last().remove();
    jQuery('.paging').last().show();
});

</script>

i don't know that this code is working or not..... pls help me to fix this....

here is the sample html content...

<ol class="jobs">
<li class="job">
                   <dt>Location</dt>
                    <dd class="location"><strong>Anywhere</strong></dd>

                    <dt>Date Posted</dt>
                    <dd class="date"><strong>27 Mar</strong> <span class="year">2013</span></dd>

                    <dd class="type"><span class="jtype freelance">Freelance</span></dd>
                    <div class="jo-content">we're looking for another great mobile developer to join our team.

We are a tight-knit, talented group of engineers and designers building custom mobile and web software for smart clients.&nbsp; We have an incredible attention to detail ...</div>

            </li>
            </ol>
2
Contributors
1
Reply
13
Views
4 Years
Discussion Span
Last Post by LastMitch
0

hi all.. i'm trying to get the next page content inside the <ol> tag to append within the current page <ol> tag... given below is the jquery i'm using... when i use alert "next_page" its showing the next page's link..

This code here:

jQuery('</ol>').hide()

There shouldn't be a </ol> tag but instead the word ol

Then it should like this:

jQuery('ol').hide()

I got no idea what you try doing. If you want to click next page or preivous page then take a look at this example. I found this online and it works. You can modify the code to suited your own code. Right now the code you provided above doesn't add up so I rather have to used something that is working so you can make changes on your own:

http://jsfiddle.net/olli/4rQRb/

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.