AlwaysHappy
05-07-2003, 10:16 AM
Hello,
I need my JavaScript to load the images after the page has loaded. This will give the illusion of faster page loading.
I'm pretty sure that the function which writes the img tag needs to activate before the page has loaded, but only load the images once an OnLoad event triggers.
This is what I had done:
<script language="javascript">
function loadI() {
document.write("<img src=img.jpg>");
}
</SCRIPT>
Later in the HTML code I would call the loadI function but this would display only the image, not the rest of the page. I don't know how (but I'm trying to) to incorporate an OnLoad event, which should then activate the function which writes the img tag into the document without erasing it with the tag itself. Am I on the right track trying to do this?
I need my JavaScript to load the images after the page has loaded. This will give the illusion of faster page loading.
I'm pretty sure that the function which writes the img tag needs to activate before the page has loaded, but only load the images once an OnLoad event triggers.
This is what I had done:
<script language="javascript">
function loadI() {
document.write("<img src=img.jpg>");
}
</SCRIPT>
Later in the HTML code I would call the loadI function but this would display only the image, not the rest of the page. I don't know how (but I'm trying to) to incorporate an OnLoad event, which should then activate the function which writes the img tag into the document without erasing it with the tag itself. Am I on the right track trying to do this?