H
H
have_a_questions2017-01-04 01:32:17
HTML
have_a_questions, 2017-01-04 01:32:17

How to load json in browser session store?

Good afternoon. I have a rest controller which returns json of no class. In the browser, json is displayed, but in sessionstorage it is not. How to upload it there?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
akzhan, 2017-01-04
@akzhan

Only through code on the client side (the server does not have access to Storage).

$.get('/eh').then((data) => {
    let json = JSON.parse(data);
    // do something with json
    window.sessionStorage.somekey = JSON.stringify(json);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question