I use a third party ad server to deliver the advertisements on my site. There are two invocation methods: IFRAME and JavaScript. I currently use the IFRAME method because it allows the full webpage to render independently of the ads ... in other words, without slowing down browser rendering time contacting and downloading images or flash animation from a third party server. I don't want the page content to be delayed being displayed because of a slow ad server or large flash animated ad. However, the JavaScript version is more full featured. Is there a way that I could use the JavaScript version while telling the browser not to execute it until the end? What if I were to include the JavaScript via an external file instead of inline?
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
Recommended Answers
Jump to Postdon't know if this is what you are looking for or if it will help, but if you call a javascript function via the onload event in the body tag, it will not run until the page is fully loaded.
<body onload="doWhatever();">
Jump to PostGlad to help the csgal.
Campkev is correct. Here is how I do it.
<html> <head> <title>My Web Page</title> <script type="text/javascript"> function LoadTrigger() { alert('This will fire after the page has finished loading.'); } window.onload = LoadTrigger; </script> </head> <body> <p> My Web Page is great! …
All 7 Replies
campkev
0
Posting Pro in Training
Troy
35
Posting Whiz
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
alpha_foobar
5
Junior Poster
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
GobBluth
0
Newbie Poster
Ziggy Rocks
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.