PDA

View Full Version : developer.yahoo.com/weather


lse
04-10-2010, 11:39 PM
I am trying get current weather for my city Polis, Cyprus
but I do not make it, in the
<body>
<div id="d"></div>

I get nothing, can you help...you may download files.js from test page below:

http://developer.yahoo.com/weather/
http://weather.yahooapis.com/forecastrss?p=CYXX0009&u=c

test page
http://www.paphoscarhire.mobi/weather/weather-polis.php

You may get help from:
http://www.w3schools.com/dom/dom_nodes_get.asp

lse123
04-17-2010, 07:54 PM
javascript permits connections from yahoo weather (external servers)?
where found ready made scripts get yahoo weather in my site(rss xml parse)?

Gjslick
04-17-2010, 10:34 PM
No, you can not make an AJAX request directly to an external domain (such as yahoo weather). What you need to do is create a php file on your site that will act as a proxy; getting the weather information with a php http request, and then returning the response data to your AJAX code.


JavaScript JavaScript
v ^
| |
php php
| |
|->- weather ->-|


Try the http_get() function in php. http://www.php.net/manual/en/function.http-get.php

-Greg