I'm trying to copy information from one page and use it on another page, but I keep getting "null" for my variable. I tried to use localStorage as a way to designate a global variable, that that's also not working and still returning null.
Is there a proper way to do this?
$( document ).ready(function() {
if ($(".panel-body").length) {
var ip = $( "td:eq( 1 )" ).text();
localStorage.setItem("ip", ip);
}
var ip = localStorage.getItem("ip");
$("input[name=ip]").val(ip)
});