I'm new to Javascript and web design, I'm making a 404 error page with Javascript and it is supposed to bring up a random z0r.de video (flash), and it won't show up :P
[CODE]
<title>FAIL 404 ERROR</title>
<h1>ERROR 404</h1>
<h1>FILE NOT FOUND</h1>
<h1>OLOLOLOL YOU FAIL!</h1>
<script type="text/javascript" language="JavaScript">
var ololololol=Math.floor(Math.random()*11)
if (ololololol=0)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_86.swf"><embed src="/z0r/z0r_86.swf" width="640" height="480"></embed></object>");
}
if (ololololol=1)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_12.swf"><embed src="/z0r/z0r_12.swf" width="640" height="480"></embed></object>");
}
if (ololololol=2)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_18.swf"><embed src="/z0r/z0r_18.swf" width="640" height="480"></embed></object>");
}
if (ololololol=3)
{
document.write (" <object width="640" height="480"><param name="movie" value="/z0r/z0r_20.swf"><embed src="/z0r/z0r_20.swf" width="640" height="480"></embed></object>");
}
if (ololololol=4)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_24.swf"><embed src="/z0r/z0r_24.swf" width="640" height="480"></embed></object>");
}
if (ololololol=5)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_25.swf"><embed src="/z0r/z0r_25.swf" width="640" height="480"></embed></object>");
}
if (ololololol=6)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_39.swf"><embed src="/z0r/z0r_39.swf" width="640" height="480"></embed></object>");
}
if (ololololol=7)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_42.swf"><embed src="/z0r/z0r_42.swf" width="640" height="480"></embed></object>");
}
if (ololololol=8)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_63.swf"><embed src="/z0r/z0r_63.swf" width="640" height="480"></embed></object>");
}
if (ololololol=9)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_76.swf"><embed src="/z0r/z0r_76.swf" width="640" height="480"></embed></object>");
}
if (ololololol=10)
{
document.write ("<object width="640" height="480"><param name="movie" value="/z0r/z0r_81.swf"><embed src="/z0r/z0r_81.swf" width="640" height="480"></embed></object>");
}
</script>
[/CODE]
Thanks in advance.
First, you're missing the html, head and body tags. Then, are you even having a folder called z0r? If not, you might want to create one with the z0r files inside.
Then, telling the user that he "failed" isn't really polite, sure you can do it, but if you're telling the user that it's his fault, that your website gives him an error, well...
Don't wonder if nobody visits your website.
Remember, web design is serious business.
[QUOTE=Torekk;25316590]First, you're missing the html, head and body tags. Then, are you even having a folder called z0r? If not, you might want to create one with the z0r files inside.
Then, telling the user that he "failed" isn't really polite, sure you can do it, but if you're telling the user that it's his fault, that your website gives him an error, well...
Don't wonder if nobody visits your website.
Remember, web design is serious business.[/QUOTE]
Thanks I'll try that.
[html]
<script type="text/javascript">
ids =
[
68,
12,
18,
20,
24,
25,
39,
42,
63,
76,
81
];
var idPicked = ids[Math.floor(Math.random()*ids.length)];
document.write('<object width="640" height="480"><param name="movie" value="/z0r/z0r_'+idPicked+'.swf"><embed src="/z0r/z0r_81.swf" width="640" height="480"></embed></object>');
</script>
[/html]
Also, it'd be nice if you'd put those files on your own server (I think you might be) to not use z0r's bandwidth.
Also, you need to put in your .htaccess file:
[code]
ErrorDocument 404 /errorpage.html
[/code]
Sorry, you need to Log In to post a reply to this thread.