I’m trying to load a modal window with a link like http://www.domain.com/?prod=lorem-ipsum-3
but it doesn’t load in Chrome, Safari or IE. Opera and FF works fine.
Modal window is called as iframe. Other buttons which supposed to open modal window also works fine in all browsers.
P.S. You can see all the code in given site.
You have a race condition in your code – the
ModalManagerinitializes the click handler during theDOMContentReadyevent and your code to click the link runs in the handler for the same event (viajQuery(document).ready()). Which one gets to run first is undefined, you could just as well consider it as random. So there is always the possibility that your code triggers a click on the hidden link but the handler for it isn’t set up yet. To prevent the race condition you could either run your code immediately afterDOMContentReady(easiest way to do this would be puttingsetTimeout(..., 0)into the event handler) or attach your event handler to the window’sloadevent instead.