Welcome Guest, Not a member yet? Register   Sign In
Jquery and Codeigniter Problem?
#1

[eluser]Procode[/eluser]
I am currently using twitter bootstrap along with codeigniter and I'm having a huge problem. For some reason none of the js is working in my template. I have included the correct code in the header and the css loads fine, but my javascript just does not want to work. I used the same exact code outside of codeigniter and it all worked fine. I even tried installing a new, separate, copy of igniter and trying it and I get the same result. Is there something I must do in order for jquery/javascript to work? I have the js files and jquery files all in place and linked to correctly, I am so puzzled to why this does not work.
#2

[eluser]xeroblast[/eluser]
check if your browser disable the javascript or you installed a plugin to your browser like "NoScript".
#3

[eluser]Procode[/eluser]
It works just fine with the same browser when there is no codeigniter.
#4

[eluser]xeroblast[/eluser]
if that's the case then probably there is an error on your codeigniter code...

it could be in your controller or model or view. try to comment everything starting in the controller and find the error exactly.
#5

[eluser]PhilTem[/eluser]
Well, it will most likely be a problem with base hrefs. Did you check that all in the head-part of your html-page listed links are correct? If they point to nowhere, i.e. you get a 404, it's obvious why it won't work Wink

If you need more advice, show us some code!
#6

[eluser]Procode[/eluser]
I just figured out the problem, I think, my jquery just isn't loading as i tried doing a simple script and it failed. However I do load jquery...

Code:
[removed][removed]

In the source it is in fact...
Code:
[removed][removed]

I am just puzzled why it is not loading.

EDIT: I'm not sure why it's not letting me show the code, but it is all fine, like I mentioned it has nothing to do with the controller.

I tried
Code:
[removed]
$(document).ready(function(){
$("#cl").click(function(){
alert("HELLO WORLD!");
});
});
[removed]

and...

<button id="cl">Click Me</button>

That doesn't even work... so this must mean jquery just isn't loading right?
#7

[eluser]InsiteFX[/eluser]
If you have FireFox install Firebug and see what is going on!




Theme © iAndrew 2016 - Forum software by © MyBB