keep c++ objects in javascript context when the pages are reloaded