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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:56:34+00:00 2026-06-02T16:56:34+00:00

I am developing HTML5, jQuery mobile application. I have to use 3rd party JSON

  • 0

I am developing HTML5, jQuery mobile application. I have to use 3rd party JSON web service to obtain data. However I am having parseerror in my jquery function. It seems the issue is that web service send JSON. I have to use JSONP since it is cross-domain. Is there anyway to do this using jQuery or javascript. Here is the code I am using.

$.ajax({
            url : jsonServiceURL + "scheduleService/retrieveMySchedules.json?callback=?",
            dataType : "json",
             beforeSend: function(x) {
              if(x && x.overrideMimeType) {
               x.overrideMimeType("application/json;charset=UTF-8");
              }
             },
            timeout : 5000
        }).success(function() {
                alert('pass');      
        }).error(function(httpObj, textStatus) {        
            alert(textStatus);
        }); 

The request goes. The response also comes. But it says parseerror. I feel this has something difference in JSON and JSONP. If I set URL to something like http://www.geonames.org/postalCodeLookupJSON?postalcode=10504&country=US&callback=? my code works fine there is no issue. The 3rd party web service also correct since all the iphone apps works fine. Only difference I see is JSON start with [{ and JSONP start with somefunction({.

The JSON is valid. I checked it with some online tools and also there are couple of iphone apps working with that web service without an issue. It seems I can’t parse it with jquery since they send JSON instead of JSONP. Please correct me if my thought is wrong. What are the possible solutions for this?

  • 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-02T16:56:36+00:00Added an answer on June 2, 2026 at 4:56 pm

    If you’re doing cross-domain requests, use jsonp. That’s good. It’s just a little different from your standard json request (done with XmlHttpRequest).

    You must send your request precising it’s jsonp :

    $.ajax({
           url : jsonpServiceURL + "scheduleService/retrieveMySchedulesJsonp?callback=?",
           dataType : "jsonp"           
     });
    

    And then you must have a function in your code that will be your callback :

    function InBrowser_receive(answer) {
            console.log('received:', answer)
        // do things with answer (the received json)
    }
    

    Personally, I usually don’t bother with sending the name of the callback to the server, as I write the server part too : I simply hardcode the callback name serverwise.

    And I like to send arguments to the server using json structures too. So my function sending the request is usually like this :

    function sendToServer(message) {
        $.ajax(
            {
                url: serverUrl,
                data: 'theQuery=' + JSON.stringify(message),
                crossDomain: true,
                dataType: 'jsonp'
            }
        );
    } 
    

    Here’s an example in one of my open source codes :
    https://github.com/Canop/braldop/blob/master/chrome/braldop/inext_com.js

    The sending function is

    braldop.sendToBraldopServer
    

    and the receiving one is

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

Sidebar

Related Questions

I am developing a PhoneGap application with JQuery mobile which requires geolocation data. Currently
I'm in early (pre-coding) stages of developing a mobile web application using jQuery Mobile
I am developing the application using jQuery Mobile 4.1. In my app, I have
I have made a set of HTML5 pages using Jquery mobile. While developing I
I am developing an HTML5 web application for mobile devices and ran into a
I'm developing an web application using asp.net MVC and jQuery. I have in my
I am developing a HTML5 web-application and compiling it with Cordova (phonegap) 1.7. I
I have a mobile webapp that I am developing using jquery mobile. I am
I am new to phonegap.I am using jquery mobile with html5 for developing android
I am currently developing a HTML5 page, so I want to use jQuery for

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.