js file

Added ajax function to js file