Waste of time? Maybe.
Nov. 7th, 2006 01:51 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Tonight, in Internet Scripting Languages, there was no lecture to speak of. The instructor handed out a lab exercise and we spent the entire three hours working on it. Oy.
Apparently, though, I tried to get too fancy... we were supposed to be writing a number-guessing game, where a random number from 0 to 100 is generated. The player has five guesses, and after each one, the Javascript is supposed to return a line of text saying whether the guess was too high, too low or correct and write it to the HTML page. I got bored and started trying to make the input a form rather than a Windows prompt, but apparently the HTML button's onClick method can't access the Javascript variable that contains the randomly-generated number. (What good is that?) There has to be a way...
I've gotten my first assignment done for the class, which is due Wednesday night, though. As described in my last post, it's supposed to be an airline website, with pages for user registration and login, a search page for flights, a page for specific flight information, FAQs, and a panel of advertising. It's here, if anyone wants to have a look. But be warned, it's not pretty. A designer I am not. ;) And since we don't yet know how to link to a database, obviously the data for the search and flight info pages had to be hard-coded just to prove that the functionality to display the information would work. I leave it as an exercise for the reader to find out just what the information is for that one flight. ;) Oh, and it should work in both InternetExploder Explorer and Firefox. I don't know about any other browsers.
Apparently, though, I tried to get too fancy... we were supposed to be writing a number-guessing game, where a random number from 0 to 100 is generated. The player has five guesses, and after each one, the Javascript is supposed to return a line of text saying whether the guess was too high, too low or correct and write it to the HTML page. I got bored and started trying to make the input a form rather than a Windows prompt, but apparently the HTML button's onClick method can't access the Javascript variable that contains the randomly-generated number. (What good is that?) There has to be a way...
I've gotten my first assignment done for the class, which is due Wednesday night, though. As described in my last post, it's supposed to be an airline website, with pages for user registration and login, a search page for flights, a page for specific flight information, FAQs, and a panel of advertising. It's here, if anyone wants to have a look. But be warned, it's not pretty. A designer I am not. ;) And since we don't yet know how to link to a database, obviously the data for the search and flight info pages had to be hard-coded just to prove that the functionality to display the information would work. I leave it as an exercise for the reader to find out just what the information is for that one flight. ;) Oh, and it should work in both Internet
no subject
Date: 2006-11-07 07:08 am (UTC)(And on a side note, I'm very surprised that they haven't covered something as basic as variable declarations and scope by this point.)
no subject
Date: 2006-11-07 07:22 am (UTC)I think what I was trying to do was create a button which, when clicked, would call the function that would determine whether the number entered was higher or lower than the random number generated. The onClick statement in the button definition didn't recognize the variable.
Though now that I'm thinking about it, I think I coded it as "onClick='checkNum(randomNum, guessedNum)'" instead of "onClick='checkNum(randomNum.value, guessedNum.value)'", since I know for a fact that the latter works as I used something similar in the assignment. I'll have to have a look tomorrow night when I'm back over there for my C# class.
no subject
Date: 2006-11-07 07:06 pm (UTC)Oh, and it should work in both Internet Exploder Explorer and Firefox. I don't know about any other browsers.
It works fairly well in Opera. Although some of the text is hard to read on the image background...
And what? No link to TT on the side? :)
Cu,
Andrew
no subject
Date: 2006-11-07 08:57 pm (UTC)Thanks - that's one I didn't think to check as I rarely use it (I did download it some months ago).
Although some of the text is hard to read on the image background...
Yeah, I know... I was playing with various colours and the red seemed to be the most consistently legible (though it would be a problem for the colour-blind). I've had similar problems when making LJ icons - there's no one colour that shows up against all backgrounds unless I wanted to make it 24pt bold.
This reminds me, I wanted to change my screen resolution and make sure everything still looked okay (I'm using percentages for my frame sizes, so it should).
As
And what? No link to TT on the side? :)
Hee. I should add it. :)
no subject
Date: 2006-11-08 03:31 pm (UTC)background images are usually frowned upon, but we're supposed to be showing that we can use a wide variety of styles.
What a lot of people do now to strike a compromise is to put the image once at the top, then put a "watermarked" version of the same image repeating below. Text shows up a lot better on watermarked text than on standard images.
Of course, any REAL web site developer would say it's all about content, style is irrelevant. :)
Cu,
Andrew
no subject
Date: 2006-11-08 09:03 pm (UTC)Now that's something I hadn't thought of - I'll remember that for next time.
Of course, any REAL web site developer would say it's all about content, style is irrelevant. :)
In that case, I'll make my next website with lime green text on a fuchsia background. Screw the colour-blind, and make the non-colour-blind completely blind. :P
no subject
Date: 2006-11-07 07:42 pm (UTC)no subject
Date: 2006-11-07 08:59 pm (UTC)no subject
Date: 2006-11-08 08:11 pm (UTC)no subject
Date: 2006-11-08 08:39 pm (UTC)no subject
Date: 2006-11-08 08:09 pm (UTC)no subject
Date: 2006-11-08 08:38 pm (UTC)