Codeigniter Bootstrap 3 Modal Not Loading Up |
[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">
[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.
[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.
[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'); });
[eluser]noideawhattotypehere[/eluser]
Yeah, now get Firefox+Firebug and you will catch every single JS error.
[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]
[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.
[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
[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.
[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 |
Welcome Guest, Not a member yet? Register Sign In |