Yahoo Clever wird am 4. Mai 2021 (Eastern Time, Zeitzone US-Ostküste) eingestellt. Ab dem 20. April 2021 (Eastern Time) ist die Website von Yahoo Clever nur noch im reinen Lesemodus verfügbar. Andere Yahoo Produkte oder Dienste oder Ihr Yahoo Account sind von diesen Änderungen nicht betroffen. Auf dieser Hilfeseite finden Sie weitere Informationen zur Einstellung von Yahoo Clever und dazu, wie Sie Ihre Daten herunterladen.
Can anyone help me with this , learning javascript from a book i got from the library?
What am i doing wrong this is objects which i am now on thanks for all your help in advance
ian
<hmtl>
<head>
<script language="javascript">
<--!
function car(seats,engine,theradio)
{
this.seats=seats;
this.engine=engine;
this.theradio=theradio;
}
var work_car=new car ("cloth", "v-6", "Tape Deck");
var fun_car=new car("leather", "v-8", "CD player");
var engine_type=fun_car.engine;
var seat_type=fun_car.seats;
var radio_type=fun_car.theradio;
//-->
<script>
</head>
</body>
<script language="javascript">
<--!
document.write("I want a car with "+seat_type+" seats.<br>");
document.write("It also needs a "+engine_type+" engine.<br>");
document.write("Oh, and I would like a "+Radio_type+" also.");
//-->
</script>
</body>
</html>
changed all what you said , but to no avail thanks for all your info, appreciated, typos etc but still not working thanks ian
changed all what you said , but to no avail thanks for all your info, appreciated, typos etc but still not working thanks ian
1 Antwort
- Anonymvor 9 JahrenBeste Antwort
I can see a few typos, but the syntax looks correct.
The html opening tag is mis-typed.
The closing tag for your first script block is missing its slash.
You have two different variables: radio_type and Radio_type. I expect you only meant to have radio_type. Javascript is case-sensitive.
It's always the little things.