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!

What is the error here ?

Status
Not open for further replies.

pmonett

Programmer
Sep 5, 2002
2,630
FR
I have this simple code, but it still gives an error. Could someone explain why ?

Code:
<html>
<head>
	<script language="javascript">
	function init(){
		document.write('<p><form id="userspace"><input type="button" onclick="play()" value="Play" /></form></p>');
	}
	
	function play(){
		document.write('<p>Done</p>');
	}
	</script>
</head>
<body onload="init()">
	
</body>
</html>

When the page loads, I see my Play button fine. When I click on it, IE tells me there is an error on the page and nothing happens.

What is the error ?

Pascal.

I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
 
See my previous answer!

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
If you are using FF, see the difference between View Source and View Generated Source and the answer is even more visible

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top