JSFiddle - React, Tailwind, and code Playground
by malonso
HTML
<div id="log"></div>
<script type="text/javascript">
// Local jQuery variable
var wt360WidgetjQuery;
var wt360Widget=(function() {
var domain="example.com";
/******** Load jQuery if not present *********/
var script_tag = document.createElement('script');
script_tag.setAttribute("type","text/javascript");
script_tag.setAttribute("src","http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js");
if (script_tag.readyState) {
script_tag.onreadystatechange = function () { // For old versions of IE
if (this.readyState == 'complete' || this.readyState == 'loaded') {
scriptLoadHandler();
}
};
} else { // Other browsers
script_tag.onload = scriptLoadHandler;
}
// Try to find the head, otherwise default to the documentElement
(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
/******** Called once jQuery has loaded ******/
function scriptLoadHandler() {
// Restore $ and window.jQuery to their previous values and store the
// new jQuery in our local wt360WidgetjQueryvariable
wt360WidgetjQuery= window.jQuery.noConflict(true);
// Call our main function
main();
}
/******** Our main function ********/
function main() {
wt360WidgetjQuery(document).ready(function($) {
$('#log').append('Main - jQuery has loaded<br />');
loadHighcharts();
});
}
function checkHighCharts(){
if (typeof window.Highcharts === 'undefined') {
wt360WidgetjQuery('#log').append('checkHighCharts - No highcharts<br />');
}
else{
wt360WidgetjQuery('#log').append('checkHighCharts - Highcharts exists<br />');
}
}
function loadHighcharts(){
var script_tag2 = document.createElement('script');
script_tag2.setAttribute("type","text/javascript");
//script_tag2.setAttribute("src","http://highcharts.com/js/testing.js");
//script_tag2.setAttribute("src","http://code.highcharts.com/highcharts.src.js");
...