Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3604862
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:03:05+00:00 2026-05-18T21:03:05+00:00

I have pagination links set-up like this: http://localhost/?page=2 http://localhost/?page=3 They are wrapped in Anchor

  • 0

I have pagination links set-up like this:

http://localhost/?page=2
http://localhost/?page=3

They are wrapped in Anchor links as the HREF attribute. I want to know how can I check first if the HREF attribute for a given ANCHOR contains the query string “page” case sensitive, and if it exists return its number the value after page=

Please give me a straightforward example on this, much appreciated. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:03:06+00:00Added an answer on May 18, 2026 at 9:03 pm

    You could try something like this:

    function getPageNumber( $obj ){
      if( $obj.filter('a[href*=page\=]').length )
        return $obj.attr('href').split('page=')[1];  
      else
        return false;
    }
    

    Then with:

    <a id="foo" href="http://localhost/?page=3">Foo</a>
    <a id="bar" href="http://localhost/?page=4">Bar</a>
    <a id="baz" href="http://localhost/?Page=5">Baz</a> <!--- capital P --->
    

    You’d get:

    var result = getPageNumber( $('a#foo') ); // returns 3
    var result = getPageNumber( $('a#bar') ); // returns 4
    var result = getPageNumber( $('a#baz') ); // returns false (case sensitive)
    

    Of course it would be easy to write the function to take a plain DOM object, or an ID, or whatever else you have in mind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have pagination links like 1,2,3,4...am trying to change appearance of current page using
I have a pagination script, which can be seen here: http://www.automotori6282.tk/phpsandbox/ This is the
I have a pagination system like this: [content] 1 2 3 Next > when
I currently have pagination functionality that displays the total page count, but I was
I have: http://jsfiddle.net/Gkz4v/9/ .pagination li a { float: left; width: 6px; height: 6px; line-height:
I have an application with associations and will pagination the pages. The index page
I have a pagination script that displays a list of all pages like so:
I have created an AJAX function that is used with pagination links to load
I'm using this code for my pagination, and I'd like the user's choice to
When using Zend_Paginator, I don't want it to show me all the pagination links.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.