> In MyTiddler, I have:

Because InlineJavascriptPlugin invokes uses eval() to invoke
javascript 'on-the-fly', any function declared via an inline script is
only available within the scope of that call to eval().  However, you
can use an explicitly-scoped function declaration to add your
functions to the global "window" object, which allows them to persist
even after the eval() processing has completed.

Instead of writing:
   function MyFunction() { ... }
you should write:
   window.MyFunction = function() { ... }

Thus:

<html>
   <span class="button" onclick="MyFunction()">Click Me</span>
</html>
<script>
   window.MyFunction=function() { alert("Clicked!"); }
</script>

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
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=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to