Template:Repeater: Difference between revisions

From ponti
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
Edit the page to see the template text.
Edit the page to see the template text.
</noinclude><includeonly>
</noinclude><includeonly>
<html><script>
<html>
window.cb = function cb(json) {
<button onclick="nominatimsearch();" name="search">search</button>
    //do what you want with the json
    document.getElementById('output').innerHTML = json.address.road + ',' + json.address.city;
}
window.search = function search(lat,long) {
    var s = document.createElement('script');
    s.src = 'http://nominatim.openstreetmap.org/reverse?json_callback=cb&format=json&lat='+lat+'&lon='+long+'&addressdetails=1';
    document.getElementsByTagName('head')[0].appendChild(s);
};
</script>
 
<button onclick="search();" name="search">search</button>
<div id="output"></div>
<div id="output"></div>
</html>
</html>

Revision as of 18:14, 1 December 2014

This is the 'Repeater' template.

Edit the page to see the template text.