Hi again RA,

So, here's maybe the missing link between your question and my
previous reply...


1) For a "proper" hijack you always start with storing the original
function...

if (Story.prototype.someCoreFunction_myBackupOf==undefined)
        Story.prototype.someCoreFunction_myBackupOf
=Story.prototype.someCoreFunction;


2) Overwriting the original, your function is then declared based on
the previous functions premises, possibly customized to what you
actually need...

Story.prototype.someCoreFunction = function(my,args) {
//...


3) However, somewhere in the code of your replacemet  - preferably at
the very end - you are to call the original function, otherwise you're
not quite hijacking, but rather merely overwriting the original...

this.someCoreFunction_myBackupOf.apply(this,arguments);


Note the __apply(this,arguments)__ part, shoving over all of what you
possibly ignored. There you go, another how-to-properly hijack in 5
Minutes plus some more...

As for me, this - and what I mentioned before, and also object
literals, array shorthands, functions as firstclass objects, etc... -
is the kind of stuff where javascript slowly but profoundly starts
making you feel that it's not just some cheap-ass browser scripting
engine, but rather in the realm of the more powerful tools for
expressing yourself in code around today ...lean and mean ;-)

Tobias.

--

You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.


Reply via email to