Hi Eric, that sounds really interesting, and on the right way to accomplish 
what I set out to, so if I were to place this in a tiddler tagged with 
$:/tags/RawMarkup

<script type="text/javascript"> 
        var totalCount = 10;
        function ChangeIt() 
        {
        var num = Math.ceil( Math.random() * totalCount );
        // Number padding
        function pad(n) {
            return (n < 10) ? ("0" + n) : n;
        };
        var pnum = pad(num)
        document.body.background = 'path/to/image'+pnum+'.jpg';
        }
</script>

where would I need to place this part to run in on every load?
</body>
<script type="text/javascript">
    ChangeIt();
</script>
</html>

That's the part that is probably only possible in 5.1.8, right?
Also the document.body.background = 'path/to/image'+pnum+'.jpg'; would 
probably need some adjustments too, like
replacing with html body.tc-body and the rest of the background image 
style, right?


On Thursday, 12 March 2015 02:55:16 UTC, Eric Shulman wrote:
>
> On Wednesday, March 11, 2015 at 6:50:39 PM UTC-7, Jed Carty wrote:
>>
>> That looks like a good way to do it. It may be possible to include those 
>> scripts in a tiddlywiki using the $:/tags/RawMarkup tag. I am not sure if 
>> it would run the script when loading the page or not though.
>>
>
> I'm not certain what happens when using nodejs with separate .tid files, 
> but when TW5 writes a standalone (single file) copy of your TiddlyWiki, 
> everything tagged with $:/tags/RawMarkup is automatically "injected" 
> directly into the "head" of the file just before the closing </head> 
> marker.  If you put <script>...</script> in a tiddler with that tag is will 
> be invoked at load time... and because it's in the head of the file, it 
> runs before anything else, even the TWCore initialization.
>
> 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