browser lang:en
After a while of search i found this easy way to import in my site JSON datas from external domains.
All is made in javascript and it don't needs particular AJAX frameworks, really easy, don't you think?
Example:
<script type="text/javascript">
function results(obj) {
var rssoutput="<h1>Find meteo for locality (coords)</h1>"
rssoutput+= 'Clouds:'+obj.weatherObservation.clouds+'<br>';
rssoutput+= 'weatherCondition:'+obj.weatherObservation.weatherCondition+'<br>';
rssoutput+= 'observation:'+obj.weatherObservation.observation+'<br>';
rssoutput+= 'windDirection:'+obj.weatherObservation.windDirection+'<br>';
rssoutput+= 'elevation:'+obj.weatherObservation.elevation+'<br>';
rssoutput+= 'countryCode:'+obj.weatherObservation.countryCode+'<br>';
rssoutput+= 'lng:'+obj.weatherObservation.lng+'<br>';
rssoutput+= 'temperature:'+obj.weatherObservation.temperature+'<br>';
rssoutput+= 'dewPoint:'+obj.weatherObservation.dewPoint+'<br>';
rssoutput+= 'windSpeed:'+obj.weatherObservation.windSpeed+'<br>';
rssoutput+= 'humidity:'+obj.weatherObservation.humidity+'<br>';
rssoutput+= 'stationName:'+obj.weatherObservation.stationName+'<br>';
rssoutput+= 'datetime:'+obj.weatherObservation.datetime+'<br>';
rssoutput+= 'lat:'+obj.weatherObservation.lat+'<br>';
rssoutput+= 'hectoPascAltimeter:'+obj.weatherObservation.hectoPascAltimeter+'<br>';
rssoutput+= '<br><br><br>';
//document.write(rssoutput);
var txt = document.getElementById("meteo");
txt.innerHTML=rssoutput;
}
function dynamicScript(url){
var script=document.createElement('script');
script.src=url;script.type="text/javascript";
document.getElementsByTagName('head')[0].appendChild(script);
}
dynamicScript('http://ws.geonames.org/findNearByWeatherJSON?lat=39.542500&lng=2.594500&callback=results');
</script>
<div id="meteo"></div>
PHP is one of the most widely used open-source server-side scripting languages that exist today. With over…
in:Scripts and tutorials (0 comments)In a FBML Facebook App, your quick jump menu will require a little tweak to work in FBJS…
in:Scripts and tutorials (0 comments)Every single day, someone, somewhere is discussing something important to your business; your brand, your executives, your…
in:Scripts and tutorials (0 comments)The Singleton Pattern is one of the GoF (Gang of Four) Patterns. This particular pattern provides a…
in:Scripts and tutorials (0 comments)Because of the near-spherical shape of the Earth, calculating an accurate distance between two points requires the use…
in:Scripts and tutorials (1 comments)With this script we can limit the download speed // local file that should be send to the client $local_file…
in:Scripts and tutorials (0 comments)Some hosts disabled the ini setting allow_url_fopen. This also means that the ability to easily grab images…
in:Scripts and tutorials (0 comments)The act to verify if a file exists, is one of more important tasks related to files operations,…
in:Scripts and tutorials (0 comments)
