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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:07:34+00:00 2026-06-14T22:07:34+00:00

jQuery: $.ajax({ url : url, type : ‘GET’, dataType: ‘json’, data: { ‘FN’ :

  • 0

jQuery:

$.ajax({
url : url,
type : 'GET',
dataType: 'json',
data: {
    'FN'    : 'GetPages',
    'PIN'   : '7659' 
},
xhrFields: {
   withCredentials: true
},
crossDomain: true,
success: function(data) {
    alert('succsess');
    console.log('data', data);
},
error: function (xhr, ajaxOptions, thrownError) {
    alert('error');
    console.log(xhr.status);
    console.log(thrownError);
}
});

Firebug Firefox Network

Firebug Error

What happens

The AJAX “error:” event gets triggered and my console.log outputs are:

xhr.status -> 0

thrownError -> (empty String)

Is this normal? When I type the URL in a browser I receive a file download with the JSON content in it, this shouldn’t be a problem right?

  • 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-14T22:07:36+00:00Added an answer on June 14, 2026 at 10:07 pm

    Thanks to @CrimsonChin I know its a Same Origin Policy problem

    In computing, the same origin policy is an important security concept
    for a number of browser-side programming languages, such as
    JavaScript. The policy permits scripts running on pages originating
    from the same site to access each other’s methods and properties with
    no specific restrictions, but prevents access to most methods and
    properties across pages on different sites.[1]

    (from http://en.wikipedia.org/wiki/Same_origin_policy)

    Granting JavaScript clients basic access to your resources simply requires adding one HTTP response header, namely:

    Access-Control-Allow-Origin: *
    Access-Control-Allow-Origin: http://foo.example.com
    

    (from http://enable-cors.org/)

    Ofc, turning the JSON response into a JSONP response would also work. Thx @djakapm

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

Sidebar

Related Questions

jQuery.ajax( { url:'http://en.wikipedia.org/wiki/Football', type:'get', dataType:'jsonp', success:function(data){alert(data);}, } i want to read wikipedia page from
I have a jQuery AJAX function like this: $.ajax({ url: 'crud/clients.php', dataType: 'json', type:
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
I have a jQuery script: $.ajax({ url: /scripts/secure/development/ajax.asp, type: POST, dataType: text, data: cmd=addresses,
jQuery code: function ajaxsubmit(){ $.ajax({ url: /update, type: POST, dataType: html }).success(function(data) { $('#result').html(data);
I have the following jQuery $.ajax({ type: GET, url: http://f.cl.ly/items/0i1V1L1k2F440L1m2Y0G/pointdata.xml, dataType: xml, success: parseXml
Here is my code: $.ajax({ url: /api/invoice/ + newInvoice._id, type: 'PUT', data: JSON.stringify(newInvoice), dataType:
I have code as below: jQuery.ajax({ url: '/Control/delete', type: 'GET', contentType: 'application/json', success: function
$(#button_title_delete).click(function(){ jQuery.ajax({type:'POST', url:'delete.php', data: 'id='+$(bid).val(), success: function(veri) { $(#delete_result).html(veri);} }); }); When i click
I'm using this jQuery AJAX call to google's ClientLogin. $.ajax({ url:https://www.google.com/accounts/ClientLogin, type:POST, data:{'Email': 'myusername',

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.