Welcome Guest, Not a member yet? Register   Sign In
jQuery pagination links not showing up in Google search results
#11

[eluser]bl00dshooter[/eluser]
Ok mate, shall you need help just tell.
#12

[eluser]The Questioner[/eluser]
Just to let anyone know who is interested within this thread that I have followed the advice given and have adapted the pagination class to generate full URLs and jQuery click functions for each page navigation element.

I've had to amend my code so that the controller also has an option to rebuild the page (rather than just the "products' thumbnails" DIV container as before).

The full URLs will be picked up by any search engines (namely Google) whilst the jQuery navigation code will be picked up by any browser which has Javascript enabled.

Code:
<div class="content-navigation-container-pagination">
    <p>
    &nbsp;<a id="pagination-link-previous" href="http://www.your-website/14/0/">&laquo; Previous</a>
    &nbsp;<a id="pagination-link-0" href="http://www.your-website/14/0/">1</a>&nbsp;<strong>2</strong>
    &nbsp;<a id="pagination-link-24" href="http://www.your-website/14/24/">3</a>
    &nbsp;<a id="pagination-link-next" href="http://www.your-website/14/24/">Next &raquo;</a>&nbsp;
    </p>
</div>

&lt;!-- jQuery overide code for pagination start --&gt;
[removed]
    $('#pagination-link-previous').click(function() {GotoAnotherPage(0);return false;});
    $('#pagination-link-0').click(function() {GotoAnotherPage(0);return false;});
    $('#pagination-link-24').click(function() {GotoAnotherPage(24);return false;});
    $('#pagination-link-next').click(function() {GotoAnotherPage(24);return false;});
[removed]
&lt;!-- jQuery overide code for pagination end --&gt;

As mentioned above, it's important to add a "return false" after each jQuery click event, otherwise the default anchor full URL will be executed.
#13

[eluser]bl00dshooter[/eluser]
[quote author="The Questioner" date="1285711650"]
As mentioned above, it's important to add a "return false" after each jQuery click event, otherwise the default anchor full URL will be executed.[/quote]

Yes, return false does the job. But you may be misusing it. You should use jQuery's preventDefault function. Read this article to find out why.




Theme © iAndrew 2016 - Forum software by © MyBB