jQuery not working - 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: jQuery not working (/showthread.php?tid=11214) |
jQuery not working - El Forum - 08-30-2008 [eluser]RaZoR LeGaCy[/eluser] Hi all, I put in the head tag. I Code: < script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript" >< / script > Then in body I put Code: < script type="text/javascript" > When I load the page it tells me that jQuery is loaded with a popup alert that I included. When I click the link and it just reloads the page. I can't see anything wrong. Thanks all. jQuery not working - El Forum - 08-30-2008 [eluser]Randy Casburn[/eluser] Hi Razor, you've got two els with tje same Id. change 1 I bet things willbe brtter. Randy jQuery not working - El Forum - 08-30-2008 [eluser]RaZoR LeGaCy[/eluser] Exactly what should I change? Sorry for the slow response lol jQuery not working - El Forum - 08-30-2008 [eluser]Bramme[/eluser] Code: < script type="text/javascript" > jQuery not working - El Forum - 08-30-2008 [eluser]Randy Casburn[/eluser] Hi Razor, I was on a plane and using my phone before. Now that I'm home and have had some dinner and can get back to you. Here is what you should change... [quote author="RaZoR LeGaCy" date="1220136417"] Code: <div id="CALL_THIS_SOMETHING_ELSE" class="DONT_CARE"> Try that and see what happens, Randy jQuery not working - El Forum - 08-30-2008 [eluser]RaZoR LeGaCy[/eluser] it still just refreshes the page. jQuery not working - El Forum - 08-30-2008 [eluser]RaZoR LeGaCy[/eluser] I am thinking it is just mvc getting in the way. Can someone post the controller and view for something this simple because I cannot get it to work in ci but plain html I can. jQuery not working - El Forum - 08-30-2008 [eluser]Randy Casburn[/eluser] I put your exact code into a fresh install of v1.6.3 of CodeIgniter and it worked perfectly. I don't think it is CI or "MVC" that is getting in your way. Try it with a clean install. You problem is not CI it is with something else in your configuration or a conflict someplace else. Randy jQuery not working - El Forum - 08-30-2008 [eluser]Colin Williams[/eluser] Damn I hate when MVC screws with my JavaScript! :down: Not sure where the problem is, RaZoR LeGaCy. Try putting an alert call in the ready callback function, and see if you get anything: Code: $(document).ready( You can also shorten your code, for what it's worth: Code: $(function () { jQuery not working - El Forum - 08-30-2008 [eluser]Randy Casburn[/eluser] [quote author="Colin Williams" date="1220176647"] You can also shorten your code, for what it's worth: Code: $(function () { Not sure what you mean by this. He was constructing an event handler on the click event of the anchor tag with the id= 'test' Written the way you have it, there is no event handler. Randy |