Nelly news direct to your email:
|
|||||||
| Notices |
| Other topics Non-Nelly related discussion. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Bronze Member
![]() |
Hhhhheeeellllllpppppppp
I have to resit a javascript test the first week back from them holidays. One of the areas I'm particularly struggling with is calling a function.
Does anyone know any good online tutorials or books?
__________________
The X Files-I Want To Believe. July 24 2008
|
|
|
|
|
|
#2 |
|
Accidents don't happen
![]() |
Re: Hhhhheeeellllllpppppppp
Post your code and I might be able to help.
|
|
|
|
|
|
#3 |
|
Bronze Member
![]() |
Re: Hhhhheeeellllllpppppppp
Good Luck, i seriously hate javascript. Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<?xml version="1.0"?><HTML xmlns="<A href="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Comparing</TITLE">http://www.w3.org/1999/xhtml"><HEAD><TITLE>Comparing</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT type=text/javascript>
<!--
function newcar(){
var mycar="Honda"
var paycheck="35,000";
window.alert ("you need $" + paycheck + " to get a" +mycar);
}
function newcar(){
var mycar="Holden";
var paycheck="20,000";
window.alert("You need$" + paycheck " to get a "+mycar);
}
function newcar(){
var mycar="Bike";
var paycheck="10,000";
window.alert("You need$" + paycheck " to get a "+mycar);
}
//-->
</SCRIPT>
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>press refresh to start again </BODY></HTML>
__________________
The X Files-I Want To Believe. July 24 2008
|
|
|
|
|
|
#4 |
|
Accidents don't happen
![]() |
Re: Hhhhheeeellllllpppppppp
And what exatly are you trying to do? Call one of these functions? Like when you click on a button or link or something?
Like this? Code:
<a href="#" onclick="newcar();">New car</a> And there are two plus signs missing in two of your functions. Code:
function newcar(){
var mycar="Holden";
var pay cheque="20,000";
window.alert("You need$" + pay cheque +" to get a "+mycar);
}
function newcar(){
var mycar="Bike";
var pay cheque="10,000";
window.alert("You need$" + pay cheque +" to get a "+mycar);
}
Also, don't give multimple functions the same name in the same document. |
|
|
|
|
|
#5 |
|
Bronze Member
![]() |
Re: Hhhhheeeellllllpppppppp
Thanks for the help, best get back to it.
Michael
__________________
The X Files-I Want To Believe. July 24 2008
|
|
|
|
|
|
#6 |
|
Palladium member
![]() |
Re: Hhhhheeeellllllpppppppp
WOW ! good luck! That looks very hard
__________________
|
|
|
|
|
|
#7 |
|
Retired administrator
![]() |
Re: Hhhhheeeellllllpppppppp
Also, who wrote the code, cause it really looks like nothing
![]() Your second line should be: Code:
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Comparing</TITLE>
__________________
|
|
|
|
|
|
#8 |
|
Bronze Member
![]() |
Re: Hhhhheeeellllllpppppppp
Sadly I wrote the code, not surprisingly I failed the test the first time around.
__________________
The X Files-I Want To Believe. July 24 2008
|
|
|
|
|
|
#9 |
|
Retired administrator
![]() |
Re: Hhhhheeeellllllpppppppp
well, if you ever need some help with anything like that, go to http://www.w3schools.com
I'm quite experienced in HTML & Javascript and such, but that site still helps me every day ![]()
__________________
|
|
|
|
|
|
#10 |
|
Bronze Member
![]() |
Re: Hhhhheeeellllllpppppppp
Thanks
__________________
The X Files-I Want To Believe. July 24 2008
|
|
|
|
![]() |
| Bookmarks | |||
Digg
|
del.icio.us
|
StumbleUpon
|
Google
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|