langziyang Posted November 2, 2017 Share Posted November 2, 2017 (edited) the module js file before the jquery-1.11.0.min.js. so the js error is: Uncaught ReferenceError: $ is not defined at back.js:28 this is my code public function hookDisplayBackOfficeHeader() { if (Module::isInstalled($this->name) && Module::isEnabled($this->name) && ($this->context->controller instanceof AdminSplitStatus || $this->context->controller instanceof AdminOrdersController)) { $this->context->controller->addJS($this->_path . 'views/js/back.js'); } } how fix it? Edited November 2, 2017 by langziyang (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted November 2, 2017 Share Posted November 2, 2017 3 hours ago, langziyang said: the module js file before the jquery-1.11.0.min.js. so the js error is: Uncaught ReferenceError: $ is not defined at back.js:28 this is my code public function hookDisplayBackOfficeHeader() { if (Module::isInstalled($this->name) && Module::isEnabled($this->name) && ($this->context->controller instanceof AdminSplitStatus || $this->context->controller instanceof AdminOrdersController)) { $this->context->controller->addJS($this->_path . 'views/js/back.js'); } } how fix it? Force to load jQuery before your JS: $this->context->controller->addJquery(); 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now