JoelWebsites Posted April 3, 2015 Share Posted April 3, 2015 How do I solve these jquery issues?? Uncaught TypeError: undefined is not a function(index):134 (anonymous function)jquery-1.11.0.min.js:2 n.Callbacks.jjquery-1.11.0.min.js:2 n.Callbacks.k.fireWithjquery-1.11.0.min.js:2 n.extend.readyjquery-1.11.0.min.js:2 K I am trying to insert a slider by creating a slider module ...I have included all the js and css files in the module but the slide show will not start. public function hookHeader() { $this->context->controller->addJS($this->_path.'/js/front.js','all'); $this->context->controller->addJS($this->_path.'/js/jquery.min','all'); $this->context->controller->addJS($this->_path.'/js/slider/jquery.slider.min','all'); $this->context->controller->addCSS($this->_path.'/css/front.css','all'); $this->context->controller->addCSS($this->_path.'/css/reset.css','all'); $this->context->controller->addCSS($this->_path.'/css/style.css','all'); $this->context->controller->addCSS($this->_path.'/css/jquery.slider.css','all'); } The slideshow works great on a normal .html file... And the slideshow is one below the other see the screenshorts...Please help me solve this issue thank you. Link to comment Share on other sites More sharing options...
fred-vinapresta Posted April 4, 2015 Share Posted April 4, 2015 Hi, don't add this line: $this->context->controller->addJS($this->_path.'/js/jquery.min','all'); jquery is already embedded in prestashop Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 4, 2015 Author Share Posted April 4, 2015 Thanks for the reply However this has still not resolved the issue... Link to comment Share on other sites More sharing options...
razaro Posted April 4, 2015 Share Posted April 4, 2015 (edited) Function addJS do not have other parameter ,'all', and see if your js files are loaded in front office. Also maybe to try hook displayHeader and check code id homeslider module that comes with Prestashop. Edited April 4, 2015 by razaro (see edit history) Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 4, 2015 Author Share Posted April 4, 2015 Can someone tell me the correct procedure add js code to my module so that my slider may work? Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 4, 2015 Author Share Posted April 4, 2015 (edited) Yes I have removed 'all'...The silder is working properly on a module controller page however it is not working on my prestashop index.php page ...How to check why its not working on the index.php page? here is the code I have used for header public function hookHeader() { $this->context->controller->addCSS($this->_path.'/css/reset.css'); $this->context->controller->addCSS($this->_path.'/css/style.css'); $this->context->controller->addCSS($this->_path.'/css/jquery.slider.css'); $this->context->controller->addJS($this->_path.'/js/front.js'); $this->context->controller->addJS($this->_path.'/js/jquery-2.1.3.min'); $this->context->controller->addJS($this->_path.'/js/slider/jquery.slider.min'); $this->context->controller->addCSS($this->_path.'/css/front.css'); } I have even put public function hookdisplayHeader($params) { $this->context->controller->addCSS($this->_path.'/css/reset.css'); $this->context->controller->addCSS($this->_path.'/css/style.css'); $this->context->controller->addCSS($this->_path.'/css/jquery.slider.css'); $this->context->controller->addJS($this->_path.'/js/front.js'); $this->context->controller->addJS($this->_path.'/js/jquery-2.1.3.min'); $this->context->controller->addJS($this->_path.'/js/slider/jquery.slider.min'); $this->context->controller->addCSS($this->_path.'/css/front.css'); return $this->display(__FILE__, 'header.tpl'); } and added this to the install function $this->registerHook('displayHeader') && and even reset the module .. I cannot understand how to solve this issue.. like the homeslider module but This does not work on the homepage....it works on any module controller page.. Edited April 4, 2015 by JoelWebsites (see edit history) Link to comment Share on other sites More sharing options...
JoelWebsites Posted April 4, 2015 Author Share Posted April 4, 2015 I used displaytop for the hook 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