Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.write in a <td>

Status
Not open for further replies.

timjwild

Programmer
Oct 13, 2000
10
0
0
GB
I want to use the following to display the browser info ONLY in the onload function, without writing a new page. If I use the script without 'window.onload' it displays in the current window with it, it creates a new page within the window. Help?.

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<html>
<head>
<title>test1</title>
</head>
<body>
<table>
<tr>
<td width=&quot;33%&quot;></td>

<td><SCRIPT language=&quot;JavaScript&quot;>
<!--

window.onload=showme

function showme(){
document.write(&quot;You are using &quot;+navigator.appName+&quot; &quot;+navigator.appVersion);
}
//-->
</SCRIPT>
</td>

<td width=&quot;33%&quot;></td>
</tr>
</table>
</body>
</html> [sig][/sig]
 
Is there any particular reason that you need it to be onload. try this:

<script language=javascript>
function showme(){
document.write(&quot;You are using &quot;+navigator.appName+&quot; &quot;+navigator.appVersion);
}
showme();
</script>
[sig]<p>theEclipse<br><a href=mailto:eclipse_web@hotmail.com>eclipse_web@hotmail.com</a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>**-Trying to build a documentation of a Javascript DOM, crossbrowser, of course. E-mail me if you know of any little known events and/or methods, etc.[/sig]
 
The navigator.appName isn't actually what I want to display, it was just something to test with. I need to know how to display something, anything using 'document.write' which will be triggered by an onload event.

Thanks

Tim [sig][/sig]
 
This might help, it is pretty basic at least I understood it and I am relatively new to javascript


maybe it will help

Crystal
crystals@genesis.sk.ca

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top