If you use Symfony and its Autocomletion feature, you may get the following error: "Ajax.Autocompleter is not a constructor"
There could be two reasons for this:
- Necessary JS libraries are not loaded. To fix make sure you load the following libraries (example below is for including them from the action):
$response->addJavascript('/sf/js/prototype/prototype'); $response->addJavascript('/sf/js/prototype/effects'); $response->addJavascript('/sf/js/prototype/controls'); - You could be including Prototype JS library twice. So for the example above I am adding a prototype JS library. In addition to that I could have added it to be added in the view.yml file. This would have caused the
"Ajax.Autocompleter is not a constructor".