Data da resposta: 09 de outubro de 2024
function queryObj() {
var result = {}, keyValuePairs = location.search.slice(1).split("&");
keyValuePairs.forEach(function(keyValuePair) {
keyValuePair = keyValuePair.split('=');
result[decodeURIComponent(keyValuePair[0])] = decodeURIComponent(keyValuePair[1]) || '';
});
return result;
}
var myParam = queryObj();
console.log(myParam);
if(myParam['msg']){
document.getElementById("msg").innerHTML = "
" + myParam['msg'] + "
" }