29 十二月 2008 @ 5:31 上午 
有時候有些網頁不需要在一開始就載入urmap api,有可能是使用者觸發某個動作才要顯示地圖,這時候用原本取得API的方式(document.write)就無法作到include on demand,因此我寫了一個小程式,經過壓縮之後只有1.6kb。接下來你只要呼叫
loadUMap();
就可以顯示URMAP地圖了。 這之js檔的參數跟你在取得urmap api時所下的參數一模一樣,同樣你必須取得API key才能夠使用這隻js檔(取得UrMap API sn),若在載入完成之後要做你自定義的動作,可以再傳參數callback。例如:
loadUMap(showMap);
像這樣: 範例檔案連結↗ http://api.urmap.com/js/loadUMap.php?key=xxxxxx
Posted By: BLACKBING
Last Edit: 29 十二月 2008 @ 05:31 上午

EmailPermalink
Tags
Tags:
Categories: Programing


 

Responses to this post » (None)

 
Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


 Last 50 Posts
 Back
Change Theme...
  • Users » 30
  • Posts/Pages » 64
  • Comments » 35
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About Me



    No Child Pages.

留言板



    No Child Pages.

Album



    No Child Pages.