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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:27:09+00:00 2026-05-28T08:27:09+00:00

I’m making a request to an old server that serves up ill-formed JSON. It’s

  • 0

I’m making a request to an old server that serves up ill-formed JSON. It’s not mine, so I can’t modify the server. It’s cross-domain. Here’s my code:

$.ajax({
    url: 'http://someDomain.com/getData.htm',
    dataType: 'jsonp',
    error: function(jqXHR, textStatus, errorThrown) {
        alert("Got an error: " + textStatus + " " + errorThrown);
    },
    success: function(data) {
        alert("Got it: " + data);
    }
});

As it stands, of course, I get:

Got an error: parseerror Jquery12379789584794587_2893798579279874978 was not called.

So it’s choking because the JSON-esque response looks like this:

{name:"RMA-83186",date:"01/24/12 13:30:45"}

…and jQuery rightfully requires it to be well-formed JSON. (It’s not because the properties should be double-quoted. See the “Important” note here.)

So, I thought I’d bring the response in as dataType: 'text', clean it up and then let jQuery parse it as JSON. However, when I change it to dataType: 'text' I get:

Got an error: error No transport

…which is what you get from a cross-domain request. I tried adding crossDomain: true to the request and using it with the text dataType, but got the same error.

Anyone know how I can get this ill-formed data in from a cross-domain request so I can clean and parse it?

Thanks!

EDIT: The dataFilter parm doesn’t help because the root problem (when using dataType:'jsonp') is not even the ill-formed JSON string, but rather that the response is not a true JSONp response, i.e., it’s not a function call.

  • 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-05-28T08:27:09+00:00Added an answer on May 28, 2026 at 8:27 am

    The only suggestion I think would work would be to use an intermediary server side proxy that you control. This way you can format the data correctly and feed it back to your JavaScript. You could also use a Yahoo! Pipe.

    The problem is that a JSONP call is really just a new script element added to the DOM. And you can’t request plain text because of the same origin policy. Also, since the server doesn’t return proper JSON, I’m sure it won’t work with a CORS request. Therefore, you will have to use the proxy.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to create an if statement in PHP that prevents a single post

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.