0
I am developing a PWA application that will work mainly in offiline mode, I have created and implemented virtually everything, indexedDB, service-worker, etc... I am trying to pass some parameters to another page using the GET method and to read the values in java script I am using this function:
For example, the page Indexed.php calls the page Parameters.php with some parameters:
function $_GET()
{
var parts = window.location.search.substr(1).split("&");
var GET = {};
for (var i = 0; i < parts.length; i++) {
var temp = parts[i].split("=");
GET[decodeURIComponent(temp[0])] = decodeURIComponent(temp[1]);
}
return GET;
}
And the page Parameters.php reads these values and performs some actions.
window.location.href = "/parameters.php?id=1";
The problem appears when I’m offiline and I try to load these pages, it goes wrong because the Urls are not the same as the ones that went pro cache. I have tried several ways to ignore query strings but without success. I wonder if there are some other alternative to do this, and what are the most recommended methods of passing parameters to other pages while offiline.
Welcome to Stack Overflow in English. Please click edit and translate the question.
– Luiz Augusto