I am using ajax with jQuery in my cakePHP application. and my javascript function is placed inside a javascript file.
now in my local system the files are kept
@irtiza your answer is appreciated but for cakephp latest version 3.x this will work otherwise you will get routing error.
ulr:' 'controllername', 'action' => 'actionname')); ?>'