使用jQueryYahoo API和HTML5的geolocation来开发一个天气预报web应用.docVIP

  • 36
  • 0
  • 约8.69千字
  • 约 8页
  • 2016-06-22 发布于重庆
  • 举报

使用jQueryYahoo API和HTML5的geolocation来开发一个天气预报web应用.doc

使用jQueryYahoo API和HTML5的geolocation来开发一个天气预报web应用

使用jQuery、Yahoo API和HTML5的geolocation来开发一个天气预报web应用 在线演示? 本地下载 今天我们介绍来自tutorialzine的一个HTML5/jQuery/Yahoo API的开发教程,在这篇文章中我们将介绍如何使用HTML5的Geolocation,jQuery和YahooAPI来开发一个天气预报web应用。 如果你不熟悉HTML5的Geolocation(地理位置服务),请参考我们的HTML5教程: HTML5 Geolocation。 首先你需要得到Yahoo API的API key,你可以通过如下地址取得对应的API key: /dashboard/createKey.html 以上创建过程中会要求你输入相关应用地址等信息。创建成功后,你可以得到APPID。 主要思路 在这个教程中,我们主要思路如下: 使用Geolocation取得用户的地理位置信息 然后,使用yahoo的 PlaceFinder API,来通过经纬度来找到具体地点,例如,城市或者国家。 其中包括了woeid,这个用来在天气预报应用中找到国家 最后,我们将调用yahoo的Weather API来取得天气 web应用代码 HTML !DOCTYPE html html head meta charset=gbk / titleWeather Forecast with jQuery amp; Yahoo APIs/title !-- The stylesheet -- link rel=stylesheet href=assets/css/styles.css / !-- Google Fonts -- link rel=stylesheet href=/css?family=Playball|Open+Sans+Condensed:300,700 / !--[if lt IE 9] script src=/svn/trunk/html5.js/script ![endif]-- /head body header h1Weather Forecast/h1 /header div id=weather ul id=scroller !-- The forecast items will go here -- /ul a href=# class=arrow previousPrevious/a a href=# class=arrow nextNext/a /div p class=location/p div id=clouds/div footer h2iTutorial:/i Weather Forecast with jQuery amp; Yahoo APIs/h2 a class=tzine href=/2012/05/weather-forecast-geolocation-jquery/Head on to iTutorialbzine/b/i to download this example/a /footer !-- JavaScript includes - jQuery, turn.js and our own script.js -- script src=/jquery-1.7.2.min.js/script script src=assets/js/script.js charset=utf-8/script /body /html Javascript $(function(){ /* Configuration */ var APPID = fa2pT26k; // Your Yahoo APP id var DEG = c; //

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档