removed php code from js view and fixed bug with previous ajax link not working