added jquery
changed autosave event to a jquery event