how to pass a js object through url
i have a js object
var info = {
status: 1 ,
time: "10:00:00-12:00:00" ,
weekdays: {
"monday",
"tuesday"
}
};
i don’t want to use serialize, i want something like “localhost/jstest/#test?info”
Is there any way i can achieve this
You are going to have to serialize it one way or another. You could do it in the way you suggest by storing a JSON string representing your object in e.g.
sessionStorage, and passing the name of the key:You can then access the data stored in that key: