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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:51:27+00:00 2026-06-06T21:51:27+00:00

I have a basic collection that does a fetch on document ready: ie: message_list.fetch({

  • 0

I have a basic collection that does a fetch on document ready: ie:

message_list.fetch({

            success: function(){
                console.log('success');
                //render
                grid_view.render();
            },
            error: function(xhr, text, ajax){
                //set a column limit and retru
                console.log('retrying');
                urlParams.colLimit = true;
                $.ajax(this);
                return;
            },
            data: urlParams,
            processData:true
        });

This grabs a json from the server, which is querying an hbase table with thrift. With certain accounts the dataset in hbase is too large and it runs out of memory and returns a 500 response. So I want to refire the same ajax call on error after I add a new query param. Looking at the jquery .ajax documentation it says to call $.ajax(this), but this is the window object. Also the xhr variable has empty success function. How do I refire the same ajax call with the same properties and success/error functions?

  • 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-06T21:51:29+00:00Added an answer on June 6, 2026 at 9:51 pm

    It’s pretty easy — make an object that you store and can pass back in:

    var success_cb = function(){
        console.log('success');
        //render
        grid_view.render();
    };
    
    var error_cb = function(xhr, text, ajax){
        //set a column limit and retru
        console.log('retrying');
        urlParams.colLimit = true;
        $.ajax(this);
        return;
    };
    
    var fetch_options = {
            success: success_cb, 
            error: error_cb,
            data: urlParams,
            processData:true
    }
    
    message_list.fetch(fetch_options);
    

    As long as the fetch_options is defined in the same scope as the two callback functions, and fetch_options is accessible outside of that scope, anything that can access fetch_options can use it as it’s arguments to .fetch.

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

Sidebar

Related Questions

I have a collection of user models that starts with basic data: [ {'_id':
I have a very basic python script that does HTTP connection. import socket def
I have a basic web service that returns the following object as JSON: public
I have a collection of people that is paginated with will_paginate @people = Person.paginate
We have a data grid on a window that is bound to a collection
I have basic Spring MVC 3 setup for i18n where I can show labels
I have basic idea on Kilo Virtual Machine on Mobiles , I have clear
I have basic hello word example of Prime Faces. I have created dynamic web
I have a basic nServicebus 3.2.0 setup with a web application endpoint and a
I have a basic web application written in Java, running on a tomcat on

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.