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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:00:11+00:00 2026-05-23T13:00:11+00:00

A little background: I am trying to implement and AJAX powered SlickGrid. There isn’t

  • 0

A little background:

I am trying to implement and AJAX powered SlickGrid. There isn’t much documentation so I used this example as a base.

In this example there is the following code that hits the desired web service to get the data:

req = $.jsonp({
                    url: url,
                    callbackParameter: "callback",
                    cache: true, // Digg doesn't accept the autogenerated cachebuster param
                    success: onSuccess,
                    error: function(){
                        onError(fromPage, toPage)
                    }
                    });
                req.fromPage = fromPage;
                req.toPage = toPage;

I’m not exactly sure what jsonp does but from what i’ve read it appears to be very similar to the ajax method in jQuery except it returns json and allows cross domain requests. The webservice that I happen to be calling only returns XML so I changed this chunk of code to:

req = $.ajax({
                url: "/_vti_bin/lists.asmx",
                type: "POST",
                dataType: "xml",
                data: xmlData,
                complete: onSuccess,
                error: function (xhr, ajaxOptions, thrownError) {
                    alert("error: " + xhr.statusText);
                    alert(thrownError);
                },
                contentType: "text/xml; charset=\"utf-8\""
            });
            req.fromPage = fromPage;
        req.toPage = toPage;

My issue is that my page errors out at req.fromPage = fromPage; because req is null.

Am I wrong to think that I can just replace my jsonp call with a call to the ajax method? Is req just not set because my ajax call hasn’t finished by the time that code is executed? How can I get around either of these issues?

If I comment out the last two lines and hard-code those values elsewhere everything runs fine.

  • 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-23T13:00:11+00:00Added an answer on May 23, 2026 at 1:00 pm

    Am I wrong to think that I can just replace my jsonp call with a call to the ajax method?

    No, that should work just fine.

    Is req just not set because my ajax call hasn’t finished by the time that code is executed?

    Yes, that is correct.

    The ajax methods starts the request and returns immediately. If you want to do something after the response has arrived you should do that in the success event handler.

    You might actually want to use the success event instead of the complete event, as the complete event happens even if there is an error.

    You could specify async: false, in your settings to make the ajax call wait for the response, but that means that the browser freezes while it’s waiting.

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

Sidebar

Related Questions

Background I'm trying to implement block file locking in my C# application. The built-in
First of all a little background of my problem, i'm trying to identify how
A little background: I'm creating a set of adapters to allow communication with mobile
For a little background, I work for a firm that develops web-based enterprise social
First, a little background: I'm displaying a data set with 288 rows and 8
Background: I have a little video playing app with a UI inspired by the
A little example TTest<T> = class private f : T; public function ToString :
A little help needed. I'm receiving an xml file similar to this: <?xml version=1.0
A little background: as a way to learn multinode trees in C++, I decided
I'm trying to use .fadeIn() to make my navigational hover effects look a little

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.