For storing in browser you could use cookies or localstorage.
Alternatively, you could send state to server and later read it using AJAX.
EDIT:
Looks like you have mistake in script. Instead of
new ChessBoard('board', cfg);
you should do
new ChessBoard('board', cfg.position);