Creating a function to manage the inline script execution, see more information about this method here:
http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/index.html
This method is useful because by default, the dispatcher will use the javascript eval method, wrapping the code inside an anonymous function. Some javascript frameworks will require to be executed in the global scope, defining variables as global. The dispatcher will loose the global variables definition if you don't use namespacing.
Note: This method uses a DIV to add the script inside.