moving js to files
ajax worked!!!