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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:15:24+00:00 2026-06-06T09:15:24+00:00

In chrome and safari, the following code works fine. in firefox , all platforms,

  • 0

In chrome and safari, the following code works fine.

in firefox, all platforms, all versions, it does not work and throws an error that object is undefined (from jQuery) stopping on the $.each loop

This code calls a json web service via AJAX and returns JSON.

ideas?

CODE

 $.ajax({
    url: "URL GOES HERE",
    data: JSON.stringify({
        "geoNear": "geotestnew",
        "near": [-73.78086565, 41.014072],
        "maxDistance": 0.3
    }),
    type: "POST",
    crossDomain: true,
    contentType: "application/json",
    success: function(data) {
        var usthis = data.results;
        $.each(usthis, function(entryIndex, entry) {
            var newdis = this.dis * 69;
            $("#results").append('<br>');
            $("#results").append(newdis);
            $("#results").append('<br>');
            $("#results").append(this.obj.Name);
            $("#results").append('<br>');
        });
    },
    error: function(x, e) {
        $('body').html('error: ' + e);
    }
});
});​
  • 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-06T09:15:26+00:00Added an answer on June 6, 2026 at 9:15 am

    You haven’t set dataType in ajax options to let jQuery know what type of response to expect

       dataType:'json' // or 'jsonp' which it appears you may be using
    

    http://api.jquery.com/jQuery.ajax/

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

Sidebar

Related Questions

I have the following line of code that works fine in Firefox, Chrome and
The following code works just fine in IE, FF, Chrome and Safari, but I
I have the following code in JQuery (JavaScript), and works fine in Chrome, Safari
The following code works on the latest version of Firefox, Chrome, Safari and IE
I have a web app that works fine from all browsers (IE9, Firefox, Chrome,
I get the following error in Firefox 4 only (not in FF 3.6.16, Safari,
The following page looks good in Firefox, Safari, Chrome, IE6 and IE8... but it
The following javascript opens a pop-up in Firefox, Safari, IE, and Google Chrome: window.open(http://google.com,
document.location() function given in the logn.js code works fine in Internet Explorer but does
Does anyone have a good technical reason why the following code runs fine in

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.