Viewing Function preloader seems to prevent other scripts on the page from running

Function preloader seems to prevent other scripts on the page from running



User: Jeff R. 10 years ago
Hi
Our website link to a 3rd party to allow people to book appointments.
I have been able to insert the requisite HTML using HTML Snippet, (with the addition of Jumbo T's useful code to increase the Z-index to bring the pop up to the front)

An example that works well is here:

http://www.mbmc.com.au/test/appointments.html

When setting up a similar link on another page,
http://www.mbmc.com.au/test/dr-jeff-robinson.html

I found the link would not work until I removed this code (manually) from the end of the page:

<script>
function preloader() {
if (document.images) {
var i0=new Image();
i0.src ='images/dr-jeff-robinson/shape_3.png';
}
}
function addLoadEvent(func) {
window.onload = func;
}
addLoadEvent(preloader);
</script>

Subsequently, further editing of the page (to remove the iFrame modal link) saw Everweb seemingly remove the code itself, and it now works normally:

http://www.mbmc.com.au/dr-jeff-robinson.html

I should be happy that the "problem" is fixed but I have a few more of these links to adjust and I was hoping to understand how or why the "event preloader" code appears and seems stop the other script from working.

Thanks

Jeff Robinson


Post Reply
You must login or signup to post.