Modify js file to support ajax