interverse/Client/helper.js

20 lines
583 B
JavaScript
Raw Normal View History

function interverse_data(url,cback){
url = interverse_proxy+"?url="+url
fetch(url).then((response)=> {
if (!response.ok){
return {}
}
return response.json();
}).then((data)=>cback(data))
2022-01-25 23:49:52 -05:00
}
// https://davidwalsh.name/query-string-javascript
2022-01-25 23:49:52 -05:00
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};