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
in reply to Paul Dragoonis you can use $this->webroot if you use subfolders.
$this->webroot