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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:43:33+00:00 2026-06-15T23:43:33+00:00

in my code i have: $.ajax({ url: ‘http://chapters.zmgc.net’, dataType: ‘jsonp’, success: function(d){ // Type,Name,Link,Contact,Location,Icon

  • 0

in my code i have:

   $.ajax({
       url: 'http://chapters.zmgc.net',
       dataType: 'jsonp',
      success: function(d){   // "Type","Name","Link","Contact","Location","Icon"
        Tabzilla.zgContacts = d;
        var countries = [];
        d.rows.forEach(function(row){
          if (row[0] == 'Country') countries.push(
            {link:row[2], contact:row[3], country: row[4]}
          );     
        });

but i get an error, Uncaught SyntaxError: Unexpected token :

{
 "kind": "fusiontables#sqlresponse",
....

if i replace the url with the actual file and remove the dataType, all works as expected!

i have validated the output of http://chapters.zmgc.net at http://jsonlint.com/ and it is ok.

looking at the response headers returned from http://chapters.zmgc.net, it is:

Connection:keep-alive
Content-Type:application/json
Date:Thu, 13 Dec 2012 17:02:27 GMT
Transfer-Encoding:chunked

here is the code https://github.com/tomarcafe/Z-Tabzilla/blob/gh-pages/z-tabzilla.js#L282 i would like to replace the local file with reading the remote data?

what am i missing?

  • 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-15T23:43:34+00:00Added an answer on June 15, 2026 at 11:43 pm

    It’s because you’re asking for JSONP (JSON with padding) and getting JSON without padding. JSONP is JSON that is padded by a function call, and the only way to get it to work is by adding support for JSONP on the server.

    If you don’t have access to chapters.zmgc.net you’ll have to contact them and ask them to add support for JSONP.

    If you do have access you can add ?callback=parseThis to your url and then read that variable on server-side and pad your JSON accordingly:

    parseThis(/* put your json in here */);
    

    However, if you don’t define your own callback, jQuery will add one automatically that you can use. They will look something like this: jQuery18200710562220774591_1355419375476

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

Sidebar

Related Questions

I have code as below: jQuery.ajax({ url: '/Control/delete', type: 'GET', contentType: 'application/json', success: function
I have this code that works well: {livre:empty_name} $.ajax({ url: sent.php, type: post, dataType:
I have the following code: $.ajax({ type: 'GET', url: 'index.php?route=checkout/onepagecheckout/getpaypaldata', dataType: 'json', success: function(json)
I have the following js code: var ret; $.ajax({ type: 'GET', url: '/Pay/Build64/', dataType:
I'm having a problem. I have this code: setInterval(function() { $.ajax({ url: url, success:
I have simple code in GoogleOauth2.js file function storedAccsessToken(token) { $.ajax({ type: GET, url:
I have this code: $('#page-refresh').click( function() { $.ajax({ url: /page1.php, cache: false, dataType: html,
I have following ajax call in my JavaScript code url = 'http://news.ycombinator.com/?callback=?'; $.ajax({url:url ,async:!1,dataType:'script',
I have this jQuery code: $(document).ready(function() { $.ajax({ url: pages/+page+.php, cache: false }).done(function( html
I have the following code to make a jsonp call. var contacts; $.ajax({ url:

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.