Javascript code not being called on pageload? .net -


I am currently trying to call the javascript function when the update panel refreshes but for some reason it is not called going; Even though I am using the same method which is working for other functions.

C #, this page is in the load event:

  ScriptManager.RegisterStartupScript (UpdatePanel1, this .getType (), "modify map", "modifyMap (); ", truth);  

Javascript function:

  function modifyMap () {warning (1); // If the user is looking at the site on the map if (/ Android | WebOS | iPhone | iPad | iPod | iPod | Blackberry | iMobile | Opera Mini / iTest (navigator.userager)) // map Change the width / height of // Change the width of the cover to 100% of the screen. Document.getElementById ('wrapper-div'). Style.width = "100%"; // Set the map to fill the cover. Document.getElementById ('canvasmap'). Style.width = "100%"; // Set the height of the map. Document.getElementById ('canvasmap'). Style.height = "500px";  

Text ">

Add an onload event such as:

  window.onload = modifyMap;  

Do not put it inside a function. I always want it to be the right tag

Add an overload event to an HTML tag. > & lt; Body onload = "modifyMap ()" & gt;


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -