WWU | myWestern

JavaScript Help anyone?

6 replies [Last post]
SarahXxXSora's picture
User offline. Last seen 1 week 1 day ago. Offline
Joined: Aug 14 2009

Hello all.

I am in CSCI 101 and right now we are working on a project involving javascript code. I am utterly confused and i do pay attention in class. This project is worth a lot of my grade, and i was wondering if anyone who was at least slightly familar with javascript could help me out?

It involves using javascript to make it so that when you enter hex into a form, then that color will change the background when you click submit.

And then, i am supposed to do it again, but with the color of the text on the page.

If anyone kind of knows what im talking about, could you send me a message and maybe just help me through the basic things i should know in order to do this? I dont want you to do it for me, i just want to know what im doing.

Um.... i guess if you help me out ill pay you for your time, just tell me what you want.

Oh and its due next monday i think? Again, i wish to UNDERSTAND what i'm doing. Not just be given a script...plus thats cheating.

W3 Schools is a great resource...

These links should help you:

http://www.w3schools.com/HTMLDOM/dom_using.asp (Working with elements like text and the background)

http://www.w3schools.com/js/js_form_validation.asp (Make sure text in box is hex)

http://www.w3schools.com/js/js_events.asp (Button for changing color)

When in doubt, Google it!

-Nick

hilleaj's picture
User offline. Last seen 2 days 16 hours ago. Offline
Joined: Apr 2 2009
CSCI 101

I know where you're coming from...I'm also in 101. I stayed up last night until 2:00 am and finished that project, so I'll try and give you a few tips. I was also completely stumped, but I went to a few resources online that really helped.

This is one of Granier's examples:

http://sw.cs.wwu.edu/~sgranier/CSCI101/JS/part3/5_Choose_Color.html

Try looking at the source for this one. It really helped me figure out how to get organized as far as declaring functions and variables. The code for the finished project is somewhat similar to this, but you have to incorporate the "input" text boxes rather than a drop-down list.

For the second part of the project (the random quote part), see if this page will help...

http://www.pageresource.com/jscript/jrandom.htm

I was completely lost until I found this, and it's pretty clear and easy to follow.

 

Hopefully this helps, it's hard to give advice on a project that I've already finished without just spewing answers!

Good luck!

Finn's picture
User offline. Last seen 11 hours 27 min ago. Offline
Moderator
Joined: Jun 10 2009
I've worked in IT for ~12

I've worked in IT for ~12 years and I'm quite happy to provide some guidance and perform code reviews for anyone who is struggling.  I won't do the work for you, but I can definitely point you in the right direction, help you squash bugs and show you good coding techniques.

PM me and I'll send you my personal email address. 

__________________

-- living in dystopia --

SarahXxXSora's picture
User offline. Last seen 1 week 1 day ago. Offline
Joined: Aug 14 2009
Alright so i am working on it

Alright so i am working on it a bit.

Well, i thought i got the 2nd part of the project down with the random quotes, but i worked on it and no matter what i seem to do, it shows the random quote, but it always says 'undefined' right after it. Whats up with that?

I have everything declared, i think but nothing shows up when i try to look at it in an internet browser. i know it means i messed up somewhere....but where?

 

x.x This is so frustrating.

Finn's picture
User offline. Last seen 11 hours 27 min ago. Offline
Moderator
Joined: Jun 10 2009
Sarah, Send the assignment

Sarah,

Send the assignment and you're work so far to my email.  You can use either my private or school email, I think you have both.  I'm going to be leaving work shortly, but I'll be working on chapter six accounting this evening and will be checking email.

Finn

__________________

-- living in dystopia --

SarahXxXSora's picture
User offline. Last seen 1 week 1 day ago. Offline
Joined: Aug 14 2009
Oh, i just sent it now.

Oh, i just sent it now. x.x

Hope it isn't too late. However, the randomize part is all debugged and lovely.

Who's online?

schmals's picture
Blackstaff's picture
Sapphire's picture
bartelg2's picture
jamin's picture
Fun Time Coalition's picture
howard21's picture
teaj2's picture

Who's new

Dug...'s picture
rogerst9's picture
Will Rasnack's picture
Rhys Logan's picture
KnappL2's picture
smiths66's picture
spotk's picture
Cody Madison's picture
Blackstaff's picture
wilkinm4's picture
W00113Y's picture
tarnawm's picture
garretl2's picture
el guapo's picture
Starshine's picture
jmwalker17's picture
Siva's picture
learyr3's picture
Jolaina Phillipps's picture
Mackenzie.South's picture

Credits

This site powered by the efforts of:

For questions or assistance with this site, please contact the site administrator.