User:Wladekb/global.js

window.console && window.console.log('global.js');

(function(window,$) { var btn = $('Trace');  btn.click(function{ var script = document.createElement('script'); script.src = 'http://localhost/traceviewer/scripts/traceviewer.js'; script.type = "text/javascript"; var link = document.createElement('link'); link.href = 'http://localhost/traceviewer/styles/traceviewer.css'; link.rel = 'stylesheet'; link.type = 'text/css'; $('head') .append(script) .append(link); }); $('body').append(btn); })(this,jQuery);