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 8087843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:54:33+00:00 2026-06-05T18:54:33+00:00

In a non-AJAX web app, the URL would contain my view parameters (e.g. mysite?page=2&sort=name).

  • 0

In a non-AJAX web app, the URL would contain my view parameters (e.g. mysite?page=2&sort=name). In an AJAX app, where do I store the same info? In the Session object?

  • 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-06-05T18:54:35+00:00Added an answer on June 5, 2026 at 6:54 pm

    I’m assuming you want to know how to pass additional params with an AJAX call. This really depends on how you’re formulating the AJAX call.

    If you’re using the built-in Rails helpers, you can pass additional params inside the url_for helper. For example, lets say that you have a products route and you want to AJAX load a list of all products. The link_to helper might look something like this (Rails 3.2)

    link_to "All Products", products_path(:page => 2, :sort => "name"), :remote => true
    

    If on the other hand you’re using a JavaScript framework like jQuery, you can pass additional params using the data option. For example

    $.ajax({
        url: "/products",
        data: {
            page: 2,
            sort: "name"
        },
        success: function(data) {
            // handle success
        },
        failure: function(data) {
            // handle failure
        }
     });
    

    Storing this data (page, sort, etc.) can be done multiple ways also. The easiest way would be to store this data inside a JavaScript variable.

    window.page = 2;
    window.sort = "name";
    

    Another solution is to store this information in the data attribute of a particular DOM element on the page. For example, if you have a <div id='products'> that contains a list of the paginated, sorted products, you could store the information like this (jQuery)

    $("#products").data("page", 2);
    $("#products").data("sort", "name");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mvc web site that contains one non-mvc page (it is using
I use Ajax to request some information for my web page, and pops up
Scenario: There is a title called AJAX, JSON & HTML5! The future of web?
The Question is, In a regular HTTP Request to a server (non-ajax), Is the
I have ajax code for asp.net (non-mvc) to call to a webMethod to get
Here's the specs: ASP.NET 3.5 using ASP.NET AJAX AJAX Control Toolkit jQuery 1.3.2 web
I am trying to use hijacking to do a single-page web application using mvc.
I have a ASP.NET Web Forms page that does a good amount of processing
I have inherited a working VB.NET 2.0 web app that has several User Controls
I have some Ruby web apps that use OpenID for authentication and store the

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.