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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:16:48+00:00 2026-06-15T22:16:48+00:00

As the title says, I’m trying to access (POST) using jQuery AJAX call to

  • 0

As the title says, I’m trying to access (POST) using jQuery AJAX call to a web url, http://host:port/... or http://localhost:8080/... from a local HTML file, c:\home.html. I can’t get it to work.

I did Google and also saw several questions here but I can’t get it to work. I need some help here. Here is what I’ve tried so far.

  1. dataType: jsonp
  2. crossDomain: true
  3. Setting the header in my response:
response.setHeader("Access-Control-Allow-Origin", "*");

None of the three browsers are working – IE, FF or Chrome. The request is never reaching the server. Here are some of the errors I’m seeing.

  1. No Transport (IE) if not jsonp is used.
  2. NS_BINDING_ABORTED / Error loading content (NS_ERROR_DOCUMENT_NOT_CACHED) in FF

This is my code. I would appreciate any help. I’m using jquery-1.8.2.min.js.

var http_host =  "http://localhost:8080";

function su (pc, p) {
    var suUrl = http_host + "/ps/api/v2/authorize.json";

    $.ajax({
        type: 'POST',
        url: suUrl,
        data: {
            phone_cell: pc,
            password: p,
        },
        dataType: "json",
        crossDomain: true,
        success: osu,
        error: oe
    });
    return false;
}

function osu (d) {
    console.log(d);
}

function oe(xhr, ts, et)     {
    alert("ServerError: " + et);
}

An example would be a perfect pointer.

  • 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-15T22:16:50+00:00Added an answer on June 15, 2026 at 10:16 pm

    I suppose my code got messed up w/ all the different solutions that I was trying. I was finally able to get it to work w/ setting the header (solution that was recommended and worked for others). All that I had to do to get it to work is add the following to my REST service response.

    response.setHeader("Access-Control-Allow-Origin", "*");
    

    Update:

    I thought I figured this out but I’ve not. There is more it than just setting the header. Anyways, in my specific situation. I was trying to run my app (html, js) off of the hard drive specifically on chrome and trying to access web services available on the cloud.

    Here is how I finally solved the problem. I started the chrome w/ the following parameters.

    --disable-web-security -–allow-file-access-from-files
    

    Like I mentioned earlier, this app is really a desktop application that will be run as part of the chromium embedded framework.

    Thanks every one for your input.

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

Sidebar

Related Questions

Like the title says, how do I redirect every url that starts with http://example.com/shop
Title says it pretty much all... I'm trying to automate tests on a web
As title says, I have access to the current listitem - and it's easy
The title says everything. I'm using Visual Studio Team System 2008 Database Edition and
As the title says im am trying to fire a django signal from the
Well title says all I guess. I've tried to print_r($_SERVER) but my 'post-request' I
As title says, I will be developing an asp .net web-application all geared around
As title says, this issue happens in MS Access 2003 SP1. Does anyone know
Well as the title says i have 2 web projects that have the same
As title says, is it possible to give a user access to the rich

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.