Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bfLoadScripts(strPath) {
- var r = false;
- var scriptTag = document.createElement('script');
- scriptTag.src = strPath;
- scriptTag.type = 'text/javascript';
- scriptTag.addEventListener('load',function() {
- //alert('JS loaded');
- r = true;
- });
- var headTag = document.getElementsByTagName('head')[0];
- headTag.appendChild(scriptTag);
- }
- scriptTag.onload = scriptTag.onreadystatechange = function() {
- if ( !r && (!this.readyState || this.readyState == 'complete') ) {
- r = true;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement