reading and saving location from Java to js and vice versa