Click to See Complete Forum and Search --> : onMouseOver
asbjoern
11-12-2003, 06:44 PM
Hey I have just started learning a bit of javascript and I need some help on what proberly seems as a simpel matter.
My problem is that I canīt call more than one function in my onMouseOver event. Is that really the case and if so know do I work around it.
asbjoern
onmouseover="functionOne(); functionTwo();"
fredmv
11-12-2003, 07:17 PM
Alternatively:function doAll()
{
function1();
function2();
//...
}onmouseover="doAll();"
Seems kinda redundant to do anything like that just to run two functions, doesn't it?
asbjoern
11-12-2003, 07:43 PM
thanks it must be something else, course I wrote it just like you recommended pyro, I ill try to specifi my quastion later (its 240 in the morning my time so I am of to bed) thanks for the quiks replys
asbjoern
Sure thing... And when you re-phrase your question, the relavant code might help. :)
fredmv
11-13-2003, 01:10 AM
Originally posted by pyro
Seems kinda redundant to do anything like that just to run two functions, doesn't it? I agree with you, that's why I had "alternatively" before the code. However, he said more than one function, so in some cases, I find it easier to read inside of a function than all inside of an event handler. So you aren't always calling only two functions, you could call as many as you wanted but the code would still remain a little more readable. Either way, I see your point (I only make functions when I need to use the code more than once, which could possibly be the case), I was just offering an alternate way to do it. :D
asbjoern
11-13-2003, 10:33 AM
sorry for all the touble, it was a f...ing spelling problem as basic as it gets.
Anyway I have a new quistion for you (simpel as well) I would like to attach a .js file in my html header (just like when you attach a external stylesheet) I just don't know the tags.
asbjoern
fredmv
11-13-2003, 10:40 AM
<script type="text/javascript" src="path/to/javascript.js"></script>
<script type="text/javascript" src="functions.js"></script>
asbjoern
11-13-2003, 10:45 AM
thanks
asbjoern