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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:22:34+00:00 2026-05-18T00:22:34+00:00

I want to develop a little os x widget which fetches data from an

  • 0

I want to develop a little os x widget which fetches data from an xml source and then displays the results.
My problem is I never used javascript XMLHttpRequest before and I’m not sure what I’m doing wrong.

To start my project I want to create a simple script which returns the response header and alert it.
I’ve tried lot’s of different things I found on the web and I know it can’t be that difficult.

But whatever I try I get a ‘null‘ response. I even tried to get the content directly but with no luck.

I once heared that cross domain requests don’t work but I’m not sure if this info is up to date. And if it’s up to date then how can I make a request to a server using javascript when the javascript runs local, on my Mac in a widget ??

Here’s my code, maybe someone can show me what I’m doing wrong.

<html>
<title>This is a test</title>
<body>
This is a simple test.
    <p class="example"><a href="#" onclick="init();return false;">Try this.</a></p>
    <script type="text/javascript">
    function init()
    {   
        xmlhttprequest = new XMLHttpRequest();
        xmlhttprequest.onreadystatechange = function() {
        if (xmlhttprequest.readyState == 4) {
            alert(xmlhttprequest.getAllResponseHeaders());
            }
        }               
    var url = "http://stinfwww.informatik.uni-leipzig.de" ;
    xmlhttprequest.open("GET", url, true);
    xmlhttprequest.send(null);
    }
    </script>
</body>
</html>

If anyone got any suggestion I would really appreciate this. Or if you have any good resources (esp. on Javascript Widget Development) on this topic please let me know.

Thanks indeed

  • 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-18T00:22:34+00:00Added an answer on May 18, 2026 at 12:22 am

    Browsers restrict cross-domain requests for security purposes. So Javascript at http://localhost can’t retrieve data from a remote API

    Also read this http://htmltimes.com/cross-domain-javascript-xmlhttprequest-restriction.php

    Hope that help’s

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

Sidebar

Related Questions

I want to develop a little iPhone application, just for my personal needs. I
i want to develop a pretty basic client-server program. one software reads xml (or
I want to develop an application in which i doesn't any idea about how
I want to develop a windows application. If I use native C++ and MFC
I want to develop Java apps, real quick, what IDE should I choose?
I want to develop simple Serverless LAN Chat program just for fun. How can
I want to develop a mobile web application using asp.net 3.5 that can be
I want to develop a very simple 2D game in Python. Pygame is the
I want to develop an iPhone application using the utility template, where the flip
I want to develop ASP.NET C# based MMOG (Massively multiplayer online game). I would

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.