<!DOCTYPE html>
<html>
<body>
<p>Click the button to convert the string to lowercase letters.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var str = "Hello World!";
var res = str.toLowerCase();
document.getElementById("demo").innerHTML = res;
}
</script>
</body>
</html>
Hello Dave,
I think you must create a widget, that creates a button with the click event listener on it.
Or if you want it as macro you can try this with my SPilot4TW (https://www.quaraman.de/tw/pilot.html):
\define myfunctionbutton(text:"hello world!")
<pilot>
LOOP:
PAUSE: Try it
CLS:
T: $text$
ENDLOOP:
</pilot>
\end
Later in the tiddler: <<myfunctionbutton "You are
great!">>
This wait till the user presses the "Try it" button and then prints the text.
It is using another language as Javascript, but you can do this
in a normal Tiddler without creating a plugin yourself.
Is a tutorial somewhere that would teach me how to take this javascript code
--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/39c1ac14-4076-4d70-80a8-e85fbb0c8efa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
.... moreover... are JS macros processed from the browser, after the final tiddlywiki html conversion or are they a sort of 'tiddlywiki middleware'?
I've to know if I can program JS macros as for usual html+js websites, thinking to common dom structure or text utf-8 coding.
In the example above, §+- would be replaced with ±