using this script to parse the json value and display on first page (home.html)
I am using href tag to go on second page(Details.html)
$(function() {
var RETAIL_CRM = [];
var dmJSON = "https://cordova.eu-gb.mybluemix.net/CRM.jsp";
$.getJSON(dmJSON, function(data) {
$.each(data.RETAIL_CRM, function(i, f) {
I just want to send these three (f.S_NO , f.NAME and f.STATUS) values from home.html to Details.html
var tblRow = "<tr>" + "<td>" + "<a href=Details.html?localStorage.getItem=" + f.S_NO + "&value1=" + f.STATUS + "&value2=" + f.NAME + ">" + f.S_NO + "</td>" + "</a>" + "<td>" + f.NAME + "</td>" + "<td>" + f.STATUS + "</td>" + "</tr>";
$(tblRow).appendTo("#list");
});
These input types are on the second page (Details.html) i just want to set valued in it .
document.getElementById("crm_serialnumber").value = localStorage.getItem;
document.getElementById("crm_name").value = value1;
document.getElementById("crm_status").value = value2
});
});
I need some help .Please .
firstly i would recommend using a JavaScript framework rather than plain HTML as it makes life much more easier (look into angular/react).
the easiest way for this is to use native
localStoragefunction, which is supported in many browsers, but you are using it the wrong way.usage as stated by documentation:
you can also use the following snippet that i made for my usage:
look at my gist for complete details: $helper
UPDATED if you want to get query parameters, use the following code on the Details.html page:
getting query parameters using javaScript