cyberwombat@yifan.net (Jadow) writes:
[color=blue]
> I have a function that is used as an event for some parts of the
> script.[/color]
It is an event handler. The "e" will be the event then.
[color=blue]
> function somethind(e) {
> if (!e.currentTarget.documentElement ){
> ...
> }
> }[/color]
That requires the currentTarget property to be a document object.
[color=blue]
> I need to call this function manually (not by assigning it to an
> event) Yet I cannot seem to deal with 'e'.
> If I call it as: something(e); I get a 'not defined', if I ommit it I
> get an undefined.[/color]
If you write
something(e);
and "e" is not a defined variable, then it is ofcourse an error. You have
to add an event as argument (or any object with a currentTarget property).
Try
something({currentTarget:document});
[color=blue]
> For some reason 'e' is undefined in the calling script.[/color]
That reason is proabably that it hasn't been defined.
[color=blue]
> What decides when it is available as an event object?[/color]
When you assign it. The "e" in the function definition only
exists inside the function. It is a local name for the argument
to the function.
/L
--
Lasse Reichstein Nielsen -
lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'