English 中文(简体)
使用 go光天气皮
原标题:use google weather api with mootools

目前,我很难利用Mootools在Java的谷歌天气预报。

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"

从我能够收集到的东西(我是这样说的较新的),这个问题是由交叉接触造成的。

I have tried:

(1) 使用员额而不是方法......类似结果

(2) 使用请求。 页: 1 JSON, 而不是要求......类似结果

3)使用请求。 JSONP ......有不同的错误(我认为文件格式)。 我怀疑这一点,因为天气预报器的回归是直线的XML,也是为JSONP服务的 is。

4) 使用YQL而不是直截了当的陶器(mple URL:;

我之所以能够做到这一点,唯一的途径是把天气XML服务器带走,并通过代理向浏览器提供服务。 然而,我希望在不给我的服务器造成负担的情况下做到这一点。

如何做到这一点?

最佳回答

这是一个交叉问题。 您所找到的解决办法(pr)。 当实际网页位于贵岛......com时,浏览器不得提出请求。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签