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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:47:20+00:00 2026-05-26T20:47:20+00:00

I’m trying to read the http-response by ajax request. As an echo-server I use

  • 0

I’m trying to read the http-response by ajax request. As an echo-server I use a simple socket on my host. It returns http-response with XML in it. Just like this:

HTTP/1.1 200 OK
Date: Fri, 18 Nov 2011 03:16:22 GMT
Content-Length: 94
Connection: close
Content-Type: text/xml

got it. waiting for the next..

As a client I’m using the following ajax request:

<html>
<head>
<script type="text/javascript" src="jquery-1.5.1.js"></script>
<script type="text/javascript">
 $(document).ready(function(){
  $.ajax({        
    url: "http://localhost:8090/",
    dataType: "text",
    complete: function(jqXHR, textStatus){
                alert(textStatus);
                alert(jqXHR.responseText);
      }        
  });
});
</script>
</head>
<body>
</body>
</html> 

After this script execution I receive the following error in FF:

XML Parsing Error: no element found Location: moz-nullprincipal:{62148931-591e-41d7-8625-c86149386fc4} Line Number 1, Column 1:

I can read the resulting XML without any error if I request it using address bar in FF, Chrome and IE, but this Ajax call returns error. It seems that I’m missing something working with ajax. Can you help me with this?
Thank you.

  • 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-26T20:47:21+00:00Added an answer on May 26, 2026 at 8:47 pm

    If I’m reading your question correctly, you’re loading some HTML with Open File from a local file, and pointing it to a socket server running on localhost. FireFox will consider these to be different domains. The HTML script needs to come from the same localhost server as the XML being requested.

    In other words, for security reasons the browser will only allow AJAX requests to the “same origin”. This is a term that (for most browsers) means “same protocol, same host, same port”.

    http://localhost:8090/ is not the same origin as http://localhost or https://localhost (note the https vs. http), nor is it the same origin as an HTML file loaded off your machine (like file:///my/directory/test.html).

    You can try adding the following response header to your XML response:

    HTTP/1.1 200 OK
    Date: Fri, 18 Nov 2011 03:16:22 GMT
    Content-Length: 94
    Connection: close
    Content-Type: text/xml
    Access-Control-Allow-Origin: *
    

    If your browser supports Cross Origin Resource Sharing (CORS) then the above “Access-Control-Allow-Origin” header should allow the XML to be accessed from a different domain.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want use html5's new tag to play a wav file (currently only supported
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker

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.