you are almost there.
in your settimeout callback function do the following:
var script = document.createElement('script');
script.src = "http://whatever.com/the/script.js";
document.getElementsByTagName('head')[0].appendChild(script);
More Related Contents:
- How to get the index of highest value containing negative number from an array in javascript? [duplicate]
- javascript slice without using built in method [closed]
- What is the JavaScript version of sleep()?
- How can I upload files asynchronously with jQuery?
- Variable doesn’t get returned from AJAX function
- Function overloading in Javascript – Best practices [closed]
- What is the purpose of a plus symbol before a variable?
- Promise.all: Order of resolved values
- Encode HTML entities in JavaScript
- Serializing object that contains cyclic object value
- TypeError: p.easing[this.easing] is not a function
- PNG transparency issue in IE8
- Hide scrollbar while still being able to scroll with mouse/keyboard [duplicate]
- How can I create and style a div using JavaScript?
- Creating common controller functions
- Javascript compare 3 values
- Is optimizing JavaScript for loops really necessary?
- Visual Studio Code syntax highlighting is not working for JavaScript and TypeScript
- How can I toggle a class on click with React?
- Why do multiple `.appendTo` calls on a newly created jQuery element only append it once?
- How to open new tab in JavaScript without switching to the new tab?
- What are the advantages/disadvantages for creating a top level function in ES6 with arrows or without?
- decodeURIComponent vs unescape, what is wrong with unescape?
- Can I write files with HTML5/JS?
- How can I fix WebStorm warning “Unresolved function or method” for “require” (Firefox Add-on SDK)
- jquery use of bind vs on click
- Remove all content using pure JS
- Html duplicated ID
- How to escape backslash in JavaScript?
- .js.erb VS .js