On Thursday, March 12, 2015 at 11:31:30 AM UTC-7, Jed Carty wrote:
>
> If you are going to use javascript there shouldn't be any trouble with the 
> current version. The only place you can put raw javascript is in the head 
> using $:/tags/RawMarkup, so just try making a tiddler with both scripts and 
> tag it with $:/tags/RawMarkup and see what happens.
>

In this particular use-case (i.e, setting the background image at load 
time), tagging *both* scripts with RawMarkup has a subtle twist: 
"document.body" *does not yet exist* when the <head> of the document is 
processed.  While you can *define* the ChangeIt(...) function in the head, 
but you can't invoke it until document.body has actually been created.  To 
work around this, while still using RawMarkup for both script pieces, you 
can invoke the ChangeIt() function from within an "event listener" that 
waits for the "load" event to complete... .like this:

<script> 
   window.addEventListener("load", ChangeIt, false);
</script>

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

"Inside TiddlyWiki: The Missing Manual"
https://www.indiegogo.com/projects/inside-tiddlywiki-the-missing-manual/x/8816263
Note: the IndieGogo funding campaign has ended,
but direct fundraising continues below...

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://TiddlyTools.github.com/fundraising.html#MakeADonation

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to