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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:51:28+00:00 2026-05-23T00:51:28+00:00

$.ajax({url: ‘http://gmaps-samples-v3.googlecode.com/svn-history/r16/trunk/xmlparsing/util.js’, dataType: ‘script text text’, crossdomain:’true’, success: function(msg, status, obj){console.log(msg);console.log(status);console.log(obj)}, mimetype: ‘text/plain’, cache:false});

  • 0
$.ajax({url: 'http://gmaps-samples-v3.googlecode.com/svn-history/r16/trunk/xmlparsing/util.js', dataType: 'script text text', crossdomain:'true', success: function(msg, status, obj){console.log(msg);console.log(status);console.log(obj)}, mimetype: 'text/plain', cache:false});

I have tried running the above code and variants of it – removing mimetype, cache, setting dataType to ‘script text’ and ‘script script text’.

Straight from the jQuery Docs:

multiple, space-separated values: As
of jQuery 1.5, jQuery can convert a
dataType from what it received in the
Content-Type header to what you
require. For example, if you want a
text response to be treated as XML,
use “text xml” for the dataType. You
can also make a JSONP request, have it
received as text, and interpreted by
jQuery as XML: “jsonp text xml.”
Similarly, a shorthand string such as
“jsonp xml” will first attempt to
convert from jsonp to xml, and,
failing that, convert from jsonp to
text, and then from text to xml

I am limited to making the dataType request of type ‘script’, or else I get a “…is not allowed by Access-Control-Allow-Origin” error. But by all rights, shouldn’t I be free to interpret it within jQuery however I want to? I’ve clearly requested it as text, yet msg – the returned data from the server – is always ‘undefined’ regardless of what I do.

Are there any workarounds for this, hacky or not?

EDIT: This code works in that it loads the JavaScript file and downloads it to the user’s browser. But I still can’t view it!

  • 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-23T00:51:29+00:00Added an answer on May 23, 2026 at 12:51 am

    But by all rights, shouldn’t I be free to interpret it within jQuery however I want to?

    Security mechanisms in browsers prevent you from doing this, because it would allow you to steal users’ private information from other websites. If you are making the request to the same domain as your script is on, it will work. Otherwise you cannot make the request in JavaScript, and need to make it from a server instead.

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

Sidebar

Related Questions

Today I struggled with the following: $.ajax({url:'http://maps.google.com/maps/api/geocode/jsonaddress=Karachi&sensor=false&output=json&callback=?', dataType: 'json', success: function(data){ //eval((+data+)); alert(data); }
My code: $.ajax({ url: 'http://tinysong.com/b/Beethoven?format=json&key=<my key..>', dataType: 'jsonp', success: function(response) { console.log(response); } });
$.ajax({ url: http://ajaxhttpheaders.appspot.com, dataType: 'jsonp', success: function(headers) { language = headers['Accept-Language']; alert(language); }, //it
$.ajax({ url: http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&format=json&api_key=708f179518b2093d23f0aef284b565a4&photo_id=6115633659&jsoncallback=?, type: GET, cache: true, dataType:'jsonp', success: function (data) { var largeSRC
I have the ajax query var url = http://ISAServer.domain.com/WebSite; $.ajax({ url: url, success: function
I have an ajax function: $.ajax({ url: 'http://localhost/process.php', type: 'post', data: '', success: function(output)
I have request $.ajax({ url: 'http://translate.google.ru/translate_a/t', data: { client: x, text: sourceText, sl: langFrom,
I have a simple ajax call: $.ajax({ url: 'http://localhost:39657/List/Receptacle', dataType: json, success: function(json) {
This doesn't seem to work: $.ajax({ url: http://localhost:3000/foo.json, data: { foo: 'bar' }, headers:
$(document).ready(function() { $.ajax({url:'https://api.twitter.com/1/trends/23424829.json?callback=?', dataType:'json', success:function(data) { console.dir(data); } } ); }); example http://jsfiddle.net/W8AAZ/ i

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.