every time i run this script right here
[code]
<script language=”javascript”>
<!– Hide from browsers that do not understand Javascript
//this will welcome people to my site
//when they load my page
function welcome()
{
window.alert(“Welcome to my page”)
var y = window.prompt(“What is your name?”)
window.alert(“Cool i like that name. ” + y + ” just have a certain ring to it.”)
window.alert(“anywho welcome to Heavy metals page”)
}
// end hiding –>
</script>
it throws a single error and i dont know how to fix it, the error is
[code]
Error: missing ( before formal parameters
Source File: http://www.bowhuntr.net/heavymetal.htm
Line: 6, Column: 8
Source Code:
function
so could someone please tell me what to do to fix it or fix it and poste the fixed version up on here and tell me what was wrong so that i dont make this mistake in the future thanks for helping,
Heavy metal
You do have the <body onload="JavaScript:welcome()"> tag on the page, right?
Also, you do not need the 'window.' before prompt() or alert().[/QUOTE]
[CODE]<script language="javascript">
function
</script>[/CODE]
Charles, the url is there[/QUOTE]Duh!!
<script language="javascript">thing and it will work. Your script was fine, but another part of the pae wasn't letting the browser get that far.
function
</script>[/QUOTE]
well would you please fix it for me?[/QUOTE]Please provide the ftp address, your user name and password so that we can delete those three lines from your page.
[CODE]
<html>
<head>
<title>Heavy Metal's page</title>
<style type="text/css">
<!--
.styling{
background-color:black;
color:lime;
font: bold 15px MS Sans Serif;
padding: 3px;
}
-->
</style>
<script language="javascript">
<!-- Hide from browsers that do not understand Javascript
//this will welcome people to my site
//when they load my page
alert("Welcome to my page");
var y = prompt("What is your name?", "Name please?");
alert("Cool i like that name. " + y + " does have a certain ring to it.");
alert("anywho welcome to Heavy metals page");
function Gofindit(){
var searchfor = document.formsearch.findthis.value;
{
var FullSearchUrl =
"http://www.google.com/search?hl=en&lr=&q=" + searchfor ;
location.href = FullSearchUrl;
}}
// end hiding -->
</script>
</head>[/CODE]
I just edited the code above, i put in the ; at the end of each line[/QUOTE]Those aren't necessary.
oh you need to have a capital L in onLoad[/QUOTE]No you don't. The name of the handler is "onload". HTML is case insensitive so "onLoad" works but JavaScript and XHTML are both case sensitive and you'll need to use "onload" there.
No you don't. The name of the handler is "onload". HTML is case insensitive so "onLoad" works but JavaScript and XHTML are both case sensitive and you'll need to use "onload" there.[/QUOTE]
charles the html goodies javascript primmers say to use onLoadhttp://www.htmlgoodies.com/primers/jsp/article.php/3478511 go there to see for urself[/QUOTE]
HTML is case insensitive so "onLoad" works as well as "onload" and "ONLOAD". If you changed the DOCTYPE to XHTML, it wouldn't work except for "onload" -- as Charles Stated.[/QUOTE]
you have it wrong you all keep saying that html is case sinsitive[/quote]You sure about that? Let's review.
[i]Ultimater[/i]
HTML is case [b]insensitive[/b][/quote]
[i]Charles[/i]Yep, everyone agrees HTML is case [b]in[/b]sensitive. (Also not to be confused with XHTML, which is case [b]sensitive[/b].)
HTML is case [b]insensitive[/b][/quote]
i dont have a docutype thingy i tryed putting one in there but the code for it was always wrong and it didn't work[/quote]You really should learn how to make it work. Your pages will always be invalid HTML until you have a proper doctype. Read through the link I posted above.
I hope this isn't so obvious that it was a waste of time to post.[/QUOTE]Not at all. I'm reminded of C. S. Lewis' preface to his commentary on the [i]Psalms[/i]. Often it takes a beginner to know just what sort of help another beginner needs.
0.1.9 — BETA 5.18