The code below works correctly if I mouse over, but I need to make this command to be actioned by default when the page is loaded. This text returns the result I need ----> getclinic(0,'ON');" class="clinic-link Can anyone help? ===== snippet code starts ==== <div id="main-clinic-locator"> <a href="#" onmouseover="javascript:getclinic(0,'ON');" class="clinic-link">Mouseover Here<br />for Map & Directions<br /> to the Winchester Clinic</a> </div> ===== snippet code ends ==== Thanks Maxi
Hi, try this: <script> window.onload=function(){ getclinic(0,'ON'); //here can be also another code which you want to run after loading page } </script>
Hi Jan Thanks for the pointer... unfortunately it did not fire up the default Google map unless I inserted the following text some where .... class="clinic-link" .... after the getclinic(0,'ON'); line. However, no matter how I have inserted that text, whilst it fires up the default Google map it does not behave the same as the onmouseover action where it takes the Clinic address from the ..... <a href="#" onmouseover="javascript:getclinic(0,'ON');" class="clinic-link"> .... code and fires up the map with the correct coordinates. It appears I am not inserting that second important piece in correctly.... class="clinic-link" .... see below one example, which throws up an error, but does at least fires up the default google map. <div id="main-clinic-locator"> <script> window.onload=function(){ getclinic(0,'ON'); '<div class="clinic-link"></div>'; } </script> </div> Any further suggestions. Thanks Maxi
It seems like the functionallity works correctly after asynchronous javascript is done. Could you please post full URL where problem appears?