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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:48:04+00:00 2026-06-14T06:48:04+00:00

I am trying to write some JavaScript that calls a Web Service I’ve created.

  • 0

I am trying to write some JavaScript that calls a Web Service I’ve created. This web service is part of another

function ping() {
  $.ajax({
    url: "http://myserver/OtherSite/ping?$format=json",
    dataType: "jsonp",
    type: "GET",
    success: ping_Succeeded,
    error: ping_Failed
  });
}

function ping_Succeeded(result) {
  alert("success");
}

function ping_Failed(e1, e2, e3) {
  console.log(e1 + "\n" + e2 + "\n" + e3);
}

When I execute this code, I notice in Fiddler that my request to my web service is fine. A 200 is returned. The JSON that I am expecting is there. However, in the JavaScript console, I see an error that says: “Uncaught SyntaxError: Unexpected Token:”.

In looking in the console, I noticed the following: “message: “jQuery18209005181000102311_1352904505837 was not called”.

I don’t understand what I’m doing wrong. Can someone please tell me what is wrong with my code?

Thank you

  • 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-14T06:48:05+00:00Added an answer on June 14, 2026 at 6:48 am

    Looks like you are missing to wrap your JSON into callback call.
    Because of dataType:"jsonp" jquery will send request to an URL like this:

    OtherSite/ping?$format=json&callback=jQuery18204326352379284799_1352906037982&_=1352906037995
    

    So, you must take a name from callback and wrap your response like this (on server):

     jQuery18204326352379284799_1352906037982({ "d":{ "result":"Test 37" } })
    

    Or you can try to replace dataType:"jsonp" with dataType:"json"

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

Sidebar

Related Questions

I'm trying to write a javascript function that adds some DOM nodes to the
Alright... I'm trying to write some javascript code that will apply to an html
I am trying to write some JavaScript that draws a line by dragging the
I'm trying to write some javascript that will grab the inner text of li
Im trying to write some unit tests for a couple of merthods that are
I am currently trying to write some code that will accept some FTP details,
I am trying to write some code that will generate accurate .proto files from
Possible Duplicate: Consuming a Web service using Javascript Please note that I'm still getting
I have an ASP.NET user control that I want to write some dynamic Javascript
I am trying to write some code that allows SVG elements to be dragged

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.