On Sat, Jan 16, 2010 at 6:18 PM, shavinder <shavinderpalsi...@gmail.com>wrote:

> > The plugin is eval()'d by TiddlyWiki core after .header (and the page)
> has
> > loaded, so the body of jQuery(.header') never runs. You can just
> eliminate
> > it in your plugin and do:
> >
> > jQuery('.header').click(function(){
> >  alert('hello');
> >
> > });
> That did not work either. I then revisited classrecords.tiddlyspot.com
> and found that its easy to callup code from [[PageTemplate]]. I put
> this at the very bottom of my PageTemplate:
> <span macro="tiddler zz-myScript"></span>
>

Yes, I think my version above doesn't work because TiddlyWiki is re-applying
the page template some time after evaluating plugins. A nice workaround in
this context is jQuery's live functionality (
http://docs.jquery.com/Events/live). I've tested the following and it works:

jQuery('.header').live("click", function() {
  alert('hello');
});
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to