Jump to content


Photo

Error script


  • Please log in to reply
2 replies to this topic

#1 Hellusius

Hellusius
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts

Posted 26 July 2006 - 02:59 PM

I made a little error that pops up when someone tries to acces a link but it does not seemt to work

the script looks like this
<!--scripts--!>
<script language="JavaScript">
<!--
function tempfunc()
{
alert("Error, acces denied <br /> "The page is not yet fully done, therefor this page can not be viewed");
}
// -->
</script>
<!--scripts end--!>

and the link is done like this

<a href="index.php" onClick="tempfunc()">Altred melee</a>

Suggestions?

#2 lead2gold

lead2gold
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts
  • LocationOttawa, On

Posted 26 July 2006 - 03:04 PM

your alert() is formated impromperly.  That is why your getting the javascript error.
function tempfunc()
{
alert("Error, acces denied <br /> The page is not yet fully done, therefor this page can not be viewed");
}
(remove the extra quote)

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 26 July 2006 - 03:08 PM

Minor point adding to lead2gold's correction. <br/> will not work. You need to use \n to get a new line in a javascript alert.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users