| 1. |
Solve : WHYY isn't this working?? |
|
Answer» Code: [Select]<html> I forgot to put the condition [if] in parentheses.Errr..... Quote Code: [Select]<script type="text/javascript"> You actually put in too many parentheses in there. Unless it's a function which will be called later, you can use it this way: Code: [Select]<script type="text-javascript"> var x=20; var y=10; if x==20 { document.write("TRUE STATEMENT"); } else { document.write("FALSE STATEMENT"); } </script> Quote javascript is so specific geezIf that's the case, then FORGET what I said about learning PHP or ASP. Quote from: kpac on November 28, 2009, 03:49:32 PM Errr..... Code: [Select]<script type="text-javascript"> var x=20; var y=10; if (x==20) { document.write("TRUE STATEMENT"); } else { document.write("FALSE STATEMENT"); } </script> Do I not need parentheses around the condition? LIKE that. if (x==20) And I don't mind javascript being specific I actually like it, I just gotta get used to it, and stop making silly mistakes.... Quote Do I not need parentheses around the condition? Like that.Woops sorry. Yes, I didn't notice that. That's what happens when you're always copyin' 'n' pastin'. |
|