Invalid ajax request to joomla

There was a problem. I am writing a Joomla component. In javascript, I write a request to the server, write the path to the file (the script that should issue the data is a separate file), and it returns restricted access. What could be wrong?

Answer 1, authority 100%

show ajax request! if you are calling your component’s controller to disable the template add &format=raw; (joomla 1.5) many nuances need code !

Answer 2

This is not the case by chance: defined('_JEXEC') or die('Restricted access');? 🙂