windows.onload event call while making a widget
While working on Joomla, with infinite plugins and modules installed, I was facing the problem that Google Maps was not working on pages. After 4 hours of digging and frustrations, I finally found that one of my module was using JavaScript include in which windows.onload() event was called which is also called while loading Google Maps. So as the page was being loaded, windows.onload event of Google maps was called first and then windows.onload event of the module was called overriding event call of google maps.
Shit happens while coding and so was done by developers of the module.
Here is the learning part:
The javascript file of the module contained following code:
-
windows.onload = function()
-
{
-
localize();
-
var randomnumber = Math.floor(Math.random()*10000);
-
var date = new Date();
-
}
