Help - Search - Members - Calendar
Full Version: Webpage help...
HTMLHelp Forums > Programming > Client-side Scripting
hello all,

this is a 100% muck-around page that is not going to be put online.... biggrin.gif

just for general knowledge sakes... why doesnt this script work? sad.gif


<script language="JavaScript">
function text()
document.write("<h1 style='text-align: center'><a href=''></a></h1>");


<h2 style="text-align: center">Redirecting to external mirror...</h2>
<h3 style="text-align: center">Downloading...</h3>
<div onload="text()"></div>



I want it to load up with the text "Redirecting to external mirror..." and "Downloading..." and then I want it to wait 1 second and then display "" as a link...(ImgBurn is just an example im using.......!!)

Im guessing ive totally stuffed the div element and its probs not even neccessary tongue.gif

thanks for future help,

Christian J

The timer lacks a function call. Try calling text() from the timer.

document.write("<h1 style='text-align: center'><a href=''></a></h1>");

You can't insert an H1 element into the HEAD section of a page, put it into BODY or other valid parent element.

Also, using document.write() after the page has loaded will overwrite the existing content. Instead, try using innerHTML on some existing parent element.

<div onload="text()"></div>

DIV elements don't support the onload event. You might simply call the function from a script at the end of the page, or from an onload in the BODY start tag.

I'll fix it up and let you know if I have any problems biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.