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

  • Home
  • SEARCH
  • 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 5991861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:26:56+00:00 2026-05-22T23:26:56+00:00

Currently working on something which uses ajax for some pagination. What I’m looking to

  • 0

Currently working on something which uses ajax for some pagination. What I’m looking to do is add something like referal=3 to the end of some links then when they go to that link I’ll insert a back button with the window location for example:

User uses the ajax pagination, goes to page 3 I’ll add ?ref=3 to the end of the link or something so it would like this this:

http://foo.com/somepage/?ref=3

(not sure if that’s a corrent way of doing it)

Then the user clicks that link and I’ll append a back button on that page with that link.

So when they go back to the homepage using the generated button the window.location.href will be:

http://foo.com?ref=3

The idea is that when they click that back button, the ajax pagination will load to page 3.

I’m not sure how else to explain this, but does anyone know how I would go about doing a conditional statement dependant on the window.location.href?

  • 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-22T23:26:57+00:00Added an answer on May 22, 2026 at 11:26 pm

    To find a if the url contains some string:

    if (document.location.href.search("ref=3")!=-1){
     alert('got ref=3'); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently doing something like this in some code I'm working on right now:
The system I am currently working on requires some role-based security, which is well
I'm currently working on something like a tree, and I want to be able
I am currently working on a class that uses another class which has only
I'm currently working on a project in which i need to read some (Latitude,
I am working on a site which uses master pages (no big deal), and
I'm currently working on a reasonably simple MVC app which allows the user to
I am working on an WPF application that uses a BusinessLogic layer (currently a
I'm working on a project that uses lots of external libraries. Now, I like
I'm currently working on a windows application which is entirely model, that is, it

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.