hey, I've an error on the following code:
<html>
<head>
<title>testing javascript!</title>
<script language=JavaScript>
<!--
function URL()
{
var url=prompt("Enter the URL","http://");
var linkname=prompt("Enter the name","");
var current=document.test.display.value;
document.test.display.value=current+"<a href="+url+">"+linkname+"</a>";
}
function IMG()
{
var url=prompt("Enter the URL","http://");
var current=document.test.display.value;
document.test.display.value=current+"<img src="+url+">";
}
//-->
</script>
</head>
<body>
<form name=test>
<input type=button value="URL" onclick="URL()"> //when run, this is the line with the error
<input type=button value="IMG" onclick="IMG()"><br>
<textarea cols=30 rows=10 name=display></textarea>
</form>
</body>
</html>
The URL function doesn't work, but strangely enough, the IMG one does and they're a variation on one another...
Can anyone see something blatently obvious??? I'm better at debugging PHP than JavaScript :dunno: