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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:57:45+00:00 2026-05-26T18:57:45+00:00

I am currently having difficulty using the Google weather API in JavaScript using Mootools.

  • 0

I am currently having difficulty using the Google weather API in JavaScript using Mootools.

I am using code like this:

var location =  $('weather-location').value; 

var req = new Request({
    url: 'http://www.google.com/ig/api?weather=' + location,
    method: 'get',
    onSuccess: function(responseText, responseXML)
    {
        responseXML.getElements('forecast_information').each(function(item)
        {
            item.getElements('city').each(function(city_data)
            {
                $('placename').set('html','Weather for ' + city_data.get('data'));                  
            });
        });           
    }
}).send();   

This code results in a browser error which is reported in Firebug as:

"NetworkError: 405 Method Not Allowed - http://www.google.com/ig/api?weather=72601&location=72601"

From what I can gather (I am rather new at this), this problem is caused by cross-domain access violation.

I have tried:

1) using ‘post’ instead of ‘get’ for method… similar result

2) using Request.HTML and Request.JSON instead of Request… similar result

3) using Request.JSONP …different error (document formatting I think). I suspect this is because the google weather API returns straight XML and isn’t set up to serve JSONP.

4) using YQL instead of a straight url to google (sample URL: http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D”http%3A%2F%2Fwww.google.com%2Fig%2Fapi%3Fweather%3DDenver%2520CO”) … this did not have an error but returned no results either (URL does work if typed into address of browser).

The only way I have been able to get this to work is to pull the weather XML server-side and serve it to the browser via a proxy. However, I am would like to accomplish this without burdening my server.

How can this be done?

  • 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-26T18:57:45+00:00Added an answer on May 26, 2026 at 6:57 pm

    It is a cross-domain issue. Stick to the solution you have (proxy). The browser is not allowed to do a request to ‘google.com’ when the actual page is located at ‘yourdomain.com’.

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

Sidebar

Related Questions

I'm having difficulty using data created with canvas's todataurl() method. Currently my code sends
I am having a bit of difficulty with this current code I have set
I'm having difficulty debugging triggers in Oracle. Currently I'm using Oracle's Sql Developer tool.
I'm currently having difficulty inserting a node into a binary tree using recursion. I've
I'm currently having difficulty finding a way of making my loops work. I have
I am currently having a hardtime understanding and implementing events in C# using delagates.
I am currently having some problems with <li> in IE6 essentially my code looks
I'm currently trying to create a ray tracer in C++ but I'm having difficulty
I'm having difficulty with building a HTML email. I currently have converted my entire
I'm having difficulty getting couchdbkit to function properly on Google App Engine. I'm either

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.