solved ready and page:load in javascript