Professional Documents
Culture Documents
Fixador de SRC
Fixador de SRC
function parseQuery(qstr) {
var query = {};
var a = (qstr[0] === '?' ? qstr.substr(1) : qstr).split('&');
for (var i = 0; i < a.length; i++) {
var b = a[i].split('=');
query[decodeURIComponent(b[0])] =
decodeURIComponent(b[1] || '');
}
return query;
}
function encodeQuery(obj) {
var str = [];
for (var p in obj)
if (obj.hasOwnProperty(p)) {
str.push(encodeURIComponent(p) + "=" +
encodeURIComponent(obj[p]));
}
return str.join("&");
}
query[key] = value;
links[index].href = url;
}
}
function addQuery(item) {
var arr = item.split('=');
if(arr[0] != null && arr[1] != undefined) {
addQueryParameterToDomain(arr[0], arr[1]);
}
}
jQuery(function() {
var url = window.location.search.replace("?", "");
var itens = url.split('&');
itens.forEach(addQuery);
});
</script>