![]() |
Codeigniter Bootstrap 3 Modal Not Loading Up - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Codeigniter Bootstrap 3 Modal Not Loading Up (/showthread.php?tid=59631) Pages:
1
2
|
Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]razerone[/eluser] Hi. I am working on my modal popup for bootstrap 3 and trying to make it work with codeigniter. It will not load up in the view. I have got it working on my standard html http://codepen.io/CarraraWebsiteSolutions/pen/uzhfj. But will not work on PHP Codeigniter. I have been stuck on it all night. Why wont it load on my view. my view is home.php Javascript is kept in bottom of footer is what bootstrap recommends Code: type="text/javascript" In the home controller is Code: $this->load->view(header); In the home view is Code: <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]noideawhattotypehere[/eluser] So, first you call a function THEN you add a .js file? No way it doesnt work! PS: Get firebug. PS2: document.ready() is a very useful thing. Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]razerone[/eluser] [quote author="noideawhattotypehere" date="1383055399"]So, first you call a function THEN you add a .js file? No way it doesnt work! PS: Get firebug.[/quote] Didn't know that I am just starting to learning trying to teach my self every thing have been looking through google all day JS How Do I Call It. Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]razerone[/eluser] [quote author="noideawhattotypehere" date="1383055399"]So, first you call a function THEN you add a .js file? No way it doesnt work! PS: Get firebug. PS2: document.ready() is a very useful thing.[/quote] $( document ).ready(function() { $('#myModal').modal('toggle'); }); Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]noideawhattotypehere[/eluser] Yeah, now get Firefox+Firebug and you will catch every single JS error. Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]razerone[/eluser] [quote author="noideawhattotypehere" date="1383056372"]Yeah, now get Firefox+Firebug and you will catch every single JS error.[/quote] Says type error TypeError: $(...).modal is not a function $('#myModal').modal('toggle') [removed] $( document ).ready(function() { $('#myModal').modal('toggle'); }); [removed] Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]noideawhattotypehere[/eluser] Why dont you place all your .js in the head section of your document? You are still calling a .modal() function before having it loaded in your document. Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]razerone[/eluser] [quote author="noideawhattotypehere" date="1383056557"]Why dont you place all your .js in the head section of your document? You are still calling a .modal() function before having it loaded in your document.[/quote] It give up on that now still not working thanks for help any way. I placed it in the head gave that ago also gave it ago placing in bottom of footer. I might have to do more reading on this. works fine with normal html Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]noideawhattotypehere[/eluser] You had to screw something up in your view then, you get 'normal html' from CodeIgniter too. PHP is a server side language, all your browser gets is a html response. Codeigniter Bootstrap 3 Modal Not Loading Up - El Forum - 10-29-2013 [eluser]razerone[/eluser] [quote author="noideawhattotypehere" date="1383057372"]You had to screw something up in your view then, you get 'normal html' from CodeIgniter too. PHP is a server side language, all your browser gets is a html response.[/quote] Would you think need to load javascript helper |