Last active
September 20, 2020 10:46
-
-
Save motsu0/685dbb72760d49a9b2b00a6613f7e5c3 to your computer and use it in GitHub Desktop.
This file contains 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 get_params1(){ | |
let params = {}; | |
if(location.search!=''){ | |
location.search.replace('?','').split('&').forEach(str=>{ | |
const kv = str.split('='); | |
params[kv[0]] = decodeURI(kv[1]); | |
}); | |
} | |
output_query1(params); | |
} | |
function output_query1(params){ | |
output[0].textContent = ''; | |
let str = '{<br>'; | |
for(let key in params){ | |
str += `  ${esc_html(key)}: "${esc_html(params[key])}",<br>`; | |
} | |
str += '}'; | |
str = str.replace(',<br>}','<br>}'); | |
output[0].innerHTML = str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment