Created
February 20, 2014 13:11
-
-
Save slopeofhope81/9113201 to your computer and use it in GitHub Desktop.
my latest endeavor with javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadasync(url){ | |
var head=document.getElementsByTagName("head")[0]; | |
var script=document.createElement("script"); | |
script.src=url; | |
head.appendChild(script); | |
} | |
function urlArg(){ | |
var args = {}; | |
var query = window.location.search.substring(1); | |
var pairs = query.split("&"); | |
for (var i =0; i < pairs.length; i++){ | |
var pos = pairs[i].indexOf("="); | |
var name = pairs[i].substring(0,pos); | |
var value = pairs[i].substring(pos+1); | |
value = decodeURIComponent(value); | |
args[name]=value; | |
} | |
return args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment