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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:16:08+00:00 2026-05-29T20:16:08+00:00

Short question: is there a way to make a jsonp request to a server,

  • 0

Short question: is there a way to make a jsonp request to a server, capture the request, but not parse it as javascript? I am using dataType: “jsonp text” in jQuery 1.5 but it is not working.

I’m trying access a cross-domain URL via AJAX with jsonp. The problem is that the other domain (a directory listing at my university) is very old and I doubt the server supports jsonp.

  • In Firefox, I get a “XML tag name mismatch (expected META)” error. In chrome I get a “Uncaught SyntaxError Unexpected token <” both pointing to a file corresponding to my AJAX request . The error string from the error callback is “parsererror”.
  • I can’t do a normal AJAX call — when I change datatype to just “text” or remove it all together, the other domain complains that the user is not authenticated and redirects to a login page — even if I’ve already logged in browser side. When dataType is jsonp, this doesn’t happen.
  • I know the server needs to support JSONP, and I don’t think it does, but when I change dataType to JSONP, I can see the response page resources show up in both Chrome and Firefox — so the server actually sends the response to the browser (a static HTML webpage + some java script) — which contains the data I want to get at.
  • The problem is that jQuery is trying to parse the response as javascript, and fails (because it’s not javascript). So the data ends up in the browser — I just need to access it!
  • Using dataType: “jsonp text” which is supposed to indicate send a jsonp request and interpret the response as text makes no difference — still a parse error.

What I want is: a way to access the response from a jsonp request as plain text. Or, if I can access the raw response from a failed jsonp request — that would work too.

Thanks in advance!

Code:

ajax_url = 'https://somesite/?searchTerm='+query+'&searchType=lastname';
var jqxhr = $.ajax({type:"GET",
url: ajax_url,
dataType:"jsonp text",
callback: "whatever",
success:function(responseData) {
   $('div#content').text( responseData.slice(0, 100) );
   dbg(responseData.slice(0,100));
}})
.success(function() { alert("success"); })
.error(function(obj, errStr) { alert("error"); dbg("error: " + errStr + "test: " + test.responseText + this.responseTxt);})
.complete(function() { alert("complete"); });
  • 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-29T20:16:09+00:00Added an answer on May 29, 2026 at 8:16 pm

    What you’re trying to achieve won’t work: jsonp can only be used if and when the server properly embed the response in a javascript function call.

    Even though the server does send the file to the browser, you won’t be able to access it because of security limitations: all you can do is execute said data as a script (with a script tag) or use it as a stylesheet (using a link tag) but you’ll never, ever, be able to inspect the response in raw text if it’s from another domain.

    I suppose you tried to get the data as xml directly and that it failed (meaning the site does not support CORS). If you cannot change code server-side, then you only have two alternatives:

    1. Create a proxy on your own server that would tunnel the response (your server-side script makes the actual request and sends it to the browser): same-domain will then apply from the client’s point of view and you’ll be able to request data as XML,
    2. Use flash to bypass browser’s security (you can use flXHR but it seems to be a little dated now).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The short question, is there an off the self function to make a graph
Simple and short question: Is there a way to create a handler for custom
Is there any way to make TypeDescriptor.GetConverter.ConvertFromString convert to DateTime using a custom format
Short version question : Is there navigator.mozIsLocallyAvailable equivalent function that works on all browsers,
Short Question Is there a library that is supposed to replace mswinsoc.osx used to
Similar to This Question using linq to SQL , but I don't want to
Quick question which I fear has a short and disappointing answer but alas I
First off I'm not sure that's the proper title for this question but hopefully
On Server Fault, How to list symbolic link chains? (not my question) talks about
This is sort of a follow-up to this question . If there are multiple

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.