Click here to Skip to main content
13,046,375 members (120,673 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Guys i am trying to hit this webservice which returns me a json response
Now obviously i need it in a variable and need to make a cross domain call using jsonp but i get an  "Uncaught SyntaxError: Unexpected token : " in chrome and "invalid label" in firefox .
Following are the calls that i have tried 
a)   <pre lang="Javascript"> $.ajax({
      type: 'GET',
      url: Url,
      contentType: "application/json",
      crossDomain: true,
      data: {"customerToken": "31f65a57b1d6106c067bc00a51f9128f4db95d1d",   "clientTransactionId": "2", "callerid": "9968280904", duration: "180", "countryCode": "91", "z2vToken": "884acdd6f4293432e922d1d4b4566a3c9f1203c1"},
            dataType: 'jsonp',
            success: function() { console.log('Success!'); },
			error: function() { console.log('Uh Oh!'); },
			jsonp: 'jsonp'

i get uh oh as the answer
jQuery.getJSON(urlFromApi+"&callback=?",function(data) {

The call used above with yahoo's open apis makes it work like a charm but when used with the webservice i actually need to use gives me the same error as above.
So is possible that webservice(third party api on which i have no use) dos not support jsonp ?
Posted 29-Oct-12 19:49pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 30 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100