|
Post by ShiningSilver on Aug 2, 2008 18:30:56 GMT -5
Someone fix it
|
|
|
Post by ROBiT on Aug 2, 2008 20:34:53 GMT -5
Hmm.... I, unfortunately, am a Javascript novice, and as such, I cannot locate the problem.
|
|
|
Post by ShiningSilver on Aug 2, 2008 20:57:54 GMT -5
Oh yeah... Thanks for the help.... >.>
|
|
|
Post by ROBiT on Aug 2, 2008 21:29:02 GMT -5
Well, this is just a guess, but if 'code' is a variable (I don't know much about functions yet, so bear with me) then, maybe you need to define it beforehand?
|
|
|
Post by The One on Aug 2, 2008 21:41:41 GMT -5
Wow i have not a clue what your talking about lol
|
|
|
Post by ShiningSilver on Aug 2, 2008 22:46:12 GMT -5
I did define the "code" i think... i'll show you the original code first Edit: Here it is
|
|
|
Post by cuckooman on Aug 2, 2008 23:02:37 GMT -5
Yeah, he defined code, when he put changecolor('red') red is code.
Try document.body.bgcolor instead of document.bgcolor?
|
|
|
Post by ShiningSilver on Aug 2, 2008 23:07:12 GMT -5
But the original code works without document.body.bgcolor ...
Maybe Javascript is case-sensitive?
|
|
|
Post by ROBiT on Aug 2, 2008 23:22:23 GMT -5
The button itself works. I am not sure it is possible to change the button color, though, because of it's nature.
|
|
|
Post by The One on Aug 3, 2008 19:39:22 GMT -5
i dont get javascript
|
|
|
Post by ShiningSilver on Aug 4, 2008 11:53:21 GMT -5
The button itself works. I am not sure it is possible to change the button color, though, because of it's nature. I'm not trying to change the button's color -.- I'm trying to change the background of the site's color...
|
|
|
Post by thelisto on Aug 6, 2008 20:34:21 GMT -5
If it doesn't help then send me a PM.
|
|
|
Post by ROBiT on Aug 6, 2008 20:59:12 GMT -5
I am teh complete newb at this, so I will spend the next three days picking apart that code
|
|
|
Post by ROBiT on Aug 7, 2008 18:54:05 GMT -5
Which proves my point.
|
|
|
Post by ROBiT on Aug 7, 2008 19:15:20 GMT -5
Trying to figure out Javascript
|
|
|
Post by The One on Aug 7, 2008 19:22:44 GMT -5
Wont that take forever...
|
|
|
Post by The One on Aug 7, 2008 19:57:52 GMT -5
Wow thats long.best get reading.
|
|
ShiningSilver Not logged in
Guest
|
Post by ShiningSilver Not logged in on Aug 7, 2008 21:23:58 GMT -5
Try This, sorry I didn't get to it in time. <html>
<head> <script language="javascript" type="text/javascript"> function changeBackgroundColor(objDivID)
{ var backColor = new String();
backColor = document.getElementById(objDivID).style.backgroundColor; if(backColor.toLowerCase()=='#ffffff')
{ document.getElementById(objDivID).style.backgroundColor = '#ffffff';
}
else
{ document.getElementById(objDivID).style.backgroundColor = '#ffffff';
}
} </script> </head> <body>
<div id="div1" style="background-color : #ffffff">
Javascript will change the background color of this Div tag dynamically. </div> <input type="button" value="Click Here" onclick="changeBackgroundColor('div1')" /> </body>
</html> That is more complex... I just want someone to tell me what's wrong with MINE, not make me a new one...
|
|
|
Post by thelisto on Aug 7, 2008 21:59:18 GMT -5
Well.. I thought I would make it easy... =]
|
|
|
Post by ~Memzak~ on Aug 7, 2008 23:54:29 GMT -5
wow...
my head hurts now...
|
|