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

  • Home
  • SEARCH
  • 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 7085747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:27:47+00:00 2026-05-28T07:27:47+00:00

Im developing an web app. Here I created a popup-window in JavaScript. Now I

  • 0

Im developing an web app. Here I created a popup-window in JavaScript. Now I like to create inside this window a weather-forecast.

What is the easiest way to do this?

I did it like here: Get weather from Yahoo with jQuery

$(".popup-button").click(function(evt){
//prevent default link behavior
    evt.preventDefault();

//get id from clicked element
var id = $(this).attr("id");

switch (id) {
    case "popup-button-wetter":
        //centering with css
        centerPopup($("#popup-wrapper-wetter"));
        //load popup  
        loadPopupadditional($("#popup-wrapper-wetter"));
        //get weather
        getWeather ()
        break;
          ......


function getWeather () {
     $.get("http://weather.yahooapis.com/forecastrss?w=782458&u=c", function(data){
                   console.log("Data Loaded: " + data);
                 });
            }
    });

but then I got this error:

XMLHttpRequest cannot load http://weather.yahooapis.com/forecastrss?w=782458&u=c. Origin file:// is not allowed by Access-Control-Allow-Origin.

What does it mean?

  • 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-28T07:27:48+00:00Added an answer on May 28, 2026 at 7:27 am

    I know I’m late, but I ran into the same problem when I was building a weather page.
    I used Google’s API, but you should be able to rewrite this for Yahoo’s API rather easily:

    Do something like this in a PHP file:

    <?php
    $lat = explode(".", $_GET["lat"] * 1000000); //latitude returned by JS geolocation
    $lon = explode(".", $_GET["lon"] * 1000000); //longitude returned by JS geolocation
    $api = simplexml_load_string(utf8_encode(file_get_contents("http://www.google.com/ig/api?weather=,,," . $lat[0] . "," . $lon[0] . "&zoom=10&hl=de")));
    echo $api->weather->current_conditions->temp_c->attributes()->data; //prints the current temperature in °C
    ?>
    

    Then set the charset of your HTML page to UTF-8 by inserting

    <meta charset="utf-8">
    

    into the <head> tag in order to correctly display umlauts like ä, ö and ü.

    Tl;dr: You can bypass the cross domain AJAX block by grabbing the XML file via PHP and then sending an XMLHttpRequest to your local PHP file. 😉

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

Sidebar

Related Questions

I am facing a problem on developing my web app, here is the description:
I'm developing a web app where i have a form like that <form name=form
I hope this question belongs here. I am developing a web application for a
I am developing a simple rating system for my employer's profile based web-app. Here
I'm developing a web app and I like to make an editor just like
I am developing a mobile web app. Currently I have this snippet of jQuery
Here's the layout : I'm developing an internal ASP.NET Web App (in VB.NET) with
I'm developing web app that user can save his/her work to server. The data
im developing a web app to manager jobs, curriculum and etc... For example in
we're developing a web app to cover all aspects of a printing company from

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.