I am using ajax with jQuery in my cakePHP application.
and my javascript function is placed inside the javascript file.
now on my local system the files are stored in the "/ sample" directory, so the path when I call the function will be
in ajax.js
$.post({url : "/sample/controller/action"})
but after posting it, the url will become
$.post({url : "/mydomain.com/controller/action"})
in cakePHP we $html->urlto generate urls
but since this code is in the js file, I cannot use this function
I do not want to change all the actions associated with ajax actions manually before hosting
source
share