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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:08:40+00:00 2026-05-15T15:08:40+00:00

I read from the jQuery website, that get() loads data from the server using

  • 0

I read from the jQuery website, that get() loads data from the server using a HTTP GET request. But this explanation doesn’t suffice, such as for the example I provide below:

Just to give some context for my question, when we assign the value of two parameters to a variable expoptions:

var expoptions = $.extend(defaults, options);

The defaults parameter is an object literal of default key/value pairs that are not defined in the options parameter:

$.fn.explorerGrid = function(options) {
var defaults = {
    order: 'make',
    page: 1,
    id: 0,
    per_page: 20,
    url: "/honda",
    additional: function(){return {ololo:'trololo'};},
};

The options parameter is an object literal of key/value pairs passed as a parameter when the explorerGrid() method is invoked:

Honda.prototype.explorer_create=function(){
var component = this;
this.opts_exp = {
    order: this.default_order_str,
    url: "/"+this.resource_url_str,
    additional: function(){return component.filter_func();}
};
jQuery(this.exp_id).explorerGrid(this.opts_exp); //exp_id is just a  div container that holds a table we intend to populate with data

We then iterate through our Honda object’s object literals, assigning per_page (e.g. 20), order (e.g. ‘make’), page (e.g. 1) of our expoptions object to some global variables:

return this.each(function() {
var expobj = $(this);
var params = {
    per_page: expoptions.per_page,
    order   : expoptions.order,
    page    : expoptions.page,
};

—- The part I don’t understand —- when we call the get() method, we pass in some arguments, one is expoptions.url (e.g. ‘/honda’), params (which holds an object literal of key/value pairs that specify how we want to populate the table and it also contains another object literal from an additional() method, which contains key/value pairs of filtered criteria, such as: ‘Year: 2008’, ‘Make: Honda’), and then we call a function, which appears to be an anonymous function, passing in a parameter called data which I’m not sure where this is coming from because, like I said, this function appears not to be defined anywhere, and then it invokes the html() method on the expobj object, which is our object, such as Honda, and pulling in that data parameter.I’m not sure what the get() method is supposed to be doing with these three parameters: expoptions.url, params, function(data). If anyone knows what the get() method is doing with these parameters, I’d appreciate some explanation:

jQuery.get(expoptions.url,
params,
function(data)
{
    expobj.html(data);


    expobj.find("tr th.sortable").click(function(){
        if($(this).hasClass('sortedasc')){
            expoptions.order = "-" + $(this).attr('id');}

        if($(this).hasClass('sorteddesc')){
            expoptions.order = $(this).attr('id');}

        if(!$(this).hasClass('sorteddesc') && !$(this).hasClass('sortedasc')) {
            expoptions.order = $(this).attr('id');}
        expoptions.find_page_for_resource = 0;
        expobj.explorerGrid(expoptions);
    });

    expobj.find("#gridpage").change(function(){
        expoptions.page = 1;
        expoptions.per_page = $(this).val();
        expobj.explorerGrid(expoptions);
    });

);

Thanks for any response.

  • 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-15T15:08:41+00:00Added an answer on May 15, 2026 at 3:08 pm

    simply put, the third argument to .get, the anonymous function which begins with

    function(data)
    {
        expobj.html(data);
    

    is called by the browser once the HTTP GET request finishes, and it’s called with the response body, hence the data parameter.

    the expoptions.url tells it where to GET the data from, while the second argument is used to build the “query string”, the “?foo=bar&this=that”.

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

Sidebar

Ask A Question

Stats

  • Questions 434k
  • Answers 434k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Like everyone said, they are not the same thing. But… May 15, 2026 at 3:09 pm
  • Editorial Team
    Editorial Team added an answer This question appears to be about the C compiler driver,… May 15, 2026 at 3:09 pm
  • Editorial Team
    Editorial Team added an answer WCF by itself does not do that. There are many… May 15, 2026 at 3:09 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.