UG1234 Posted January 26, 2010 Share Posted January 26, 2010 Hi, I am using Javascript to display a map with a marker (Using OS OpenSpace). However my marker coordinates can change whilst the user is viewing the map so i would like the Marker function code to refresh and re-plot the marker every 10 seconds however i cannot work out how to do this. Adding HTML refresh command <meta http-equiv="refresh" content="10"> obviously causes the whole map to refresh. I have read that AJAX can refresh parts of the webpage without the user knowing but i have no clue how to do this. Can anyone recommend any good tutorials or point me in the right direction please. My code is below, i would like the marker function within the webpage to refresh Thanks for any help in advance <script type="text/javascript"> var osMap; function init() { osMap = new OpenSpace.Map('map'); osMap.setCenter(new OpenSpace.MapPoint(439300, 114760), ; } function marker() { var markers = new OpenLayers.Layer.Markers("Markers"); osMap.addLayer(markers); // Default icon var pos = new OpenSpace.MapPoint(438760, 114760); var marker = new OpenLayers.Marker(pos); markers.addMarker(marker); } </script> </head> <body onload="init(); marker()"> Thanks for any help in advance Link to comment https://forums.phpfreaks.com/topic/189903-please-help-refresh-part-of-my-web-page/ Share on other sites More sharing options...
RussellReal Posted January 27, 2010 Share Posted January 27, 2010 w3schools.com Link to comment https://forums.phpfreaks.com/topic/189903-please-help-refresh-part-of-my-web-page/#findComment-1002588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.