Skip to content

Commit

Permalink
improved code provided by notmasteryet
Browse files Browse the repository at this point in the history
  • Loading branch information
aSydiK committed Jul 8, 2010
1 parent 28b0a69 commit ddeccb3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions pointstream.js
@@ -1,12 +1,11 @@
var ps_include = function(path) {
var lastScript = document.getElementsByTagName("head")[0].lastChild;
var fullUrl = lastScript.src.substring(0, lastScript.src.lastIndexOf('/') + 1) + path;
document.write('<' + 'script');
document.write(' language="javascript"');
document.write(' type="text/javascript"');
document.write(' src="' + fullUrl + '">');
document.write('</' + 'script' + '>');
}
var ps_include = ((function(lastScript) {
return (function(path) {
var fullUrl = lastScript.src.substring(0, lastScript.src.lastIndexOf('/') + 1) + path;
var newScript = document.createElement("script");
newScript.src = fullUrl;
document.getElementsByTagName("head")[0].appendChild(newScript);
});
})(document.getElementsByTagName("head")[0].lastChild));

ps_include('mjs.js');
ps_include('psapi.js');

0 comments on commit ddeccb3

Please sign in to comment.