Hi! Is it possible to refresh only a <script> and not all the page?!

i have a <script> that displays google maps... and i show it on my page with other material..

i just wanted to refresh that script (google maps display), and not all the page...

i did it a refresh.. but it makes of all page..

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=x"
            type="text/javascript"></script>
  <script type="text/javascript">

	function load() {
		if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("map"));
			
			map.setCenter(new GLatLng(<? echo "$x,$y"; ?>), <?=$zoom?>);
			
			map.addControl(new GSmallMapControl());

			var point = new GPoint (<? echo "$y,$x"; ?>);
			var marker = new GMarker(point);
			map.addOverlay(marker);
			map.setUIToDefault();
		}
	}
</script>
<meta http-equiv="refresh" content="10" />

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style><body onLoad="load()" onUnload="GUnload()">

Recommended Answers

All 5 Replies

You could add a link with an onClick that will call the load() function again.

can u give me example? what code should i do?

sorry.. if you can please

oh but that i have to click on it..

i want an automatic refresh... like i did (my code it refresh the pages 10 in 10 secs)

i want is to refresh only the google map, and not all the page.. but i want it automatically...


if someone could help.. i would appreciate..

thanks a lot!

function mapRefresh(timeoutPeriod) {
	setTimeout(load(),timeoutPeriod);
}

Then add mapRefresh(10000) to the Onload event.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.