In my program i create a object for every connection and i want to retain those objects even after refreshing the webpage.how can achieve that?
<script>
var ip=prompt("Enter address of printer:", "12.222.170.99");
conn =new connection();
localStorage.setItem(ip,JSON.stringify(conn));
var a=localStorage.getItem(ip);
var b=JSON.parse(a);
b.fun();
function connection()
{
this.fun=function()
{
alert("hi");`enter code here`
}
}
</script>