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!

Syntax Error 1

Status
Not open for further replies.

gghMatt

Programmer
Oct 24, 2007
5
US
Ok, I am new at javascript programming. I created a html document with some javascript in it but when I ran it in IE it came up with this error: Line: 7, Char: 8, Syntax error, code: 0

The html code is:

<HTML>

<body background="images\fish10.gif">
<script type="text/javascript"src="functions.js"> </script> <p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p> <br><p><br><p><br><p><br> <p><br><p><br>
<font color="#E31116" size="5">
<marquee type="scroll" direction="left"><strong>This Page is under Construction!</marquee>
<input type="submit" value="go to Google!" onClick= javascript:return() >

</body>


</HTML>

The functions.js code is:

function passwordsubmit()
{
A=document.passfrm.passbox.value
if (A=="prayer1")
{
showblog()
}
else
{
alert("The password is incorrect!")
}
}


function showblog()
{
document.location.href='Prayers.html' var dirty=false
}


function return()
{

window.location='
}
 
Code:
function showblog()
{
    document.location.href='Prayers.html'[COLOR=red];[/color]
 var dirty=false
}

also return is a js keyword you should rename that function

Code:
function returnFunction()
{
           window.location='[URL unfurl="true"]http://www.google.com'[/URL]

}




Also if your button isn't a submit button you should rework it and then your onclick should be like
Code:
<button type="button" value="go to Google!" onClick="returnFunction">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top