Unable to load jquery frustrated - 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: Unable to load jquery frustrated (/showthread.php?tid=51884) Pages:
1
2
|
Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]Surrender[/eluser] i put my jquery.js in C:/wamp/www/CIajax/scripts/jquery.js and i 'm pretty sure jquery.js could be used. i echo my base_url() and the result is : http//localhost/CIajax/ so i included my jquery file like below : src="<? php echo base_url().'scripts/jquery.js'" i checked in firefox firebug and the js url shows: http://localhost/CIajax/scripts/jquery.js what confused me is that it show no object could be use,and i find my jquery.js never loaded successfully and my testing file in view like below $lt;script$gt; $(function(){ alert(" here is my testing "); }) $lt;/script$gt; help needed here Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]Sanjay Sarvaiya[/eluser] make sure that in your config file Code: $config['base_url'] = 'http://localhost/Clajax'; Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]Surrender[/eluser] my config $config['base_url']='http://localhost/CIajax/"; $config['index_page']=''; jquery include and i echo my base_url() result: http://localhost/CIajax/ include file src="<?php echo base_url().'scripts/jquery.js'? >" firebug in firefox shows src="http://localhost/CIajax/scripts/jquery.js" PS: i replaced my jquery.js on google scr="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" and it works . i wonder whether my jquery.js compatable problem Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]Surrender[/eluser] [quote author="Sanjay Sarvaiya" date="1337663858"]make sure that in your config file Code: $config['base_url'] = 'http://localhost/Clajax'; is there any difference between 'http://localhost/CIajax' and 'http://localhost/CIajax/' put http://localhost/CIajax/ in browser i works normally Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]Surrender[/eluser] [quote author="Sanjay Sarvaiya" date="1337663858"]make sure that in your config file Code: $config['base_url'] = 'http://localhost/Clajax'; my CIajax folder contents 3 subfolders and .htaccess index.php file scripts application system Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]Sanjay Sarvaiya[/eluser] [quote author="Surrender" date="1337664995"][quote author="Sanjay Sarvaiya" date="1337663858"]make sure that in your config file Code: $config['base_url'] = 'http://localhost/Clajax'; is there any difference between 'http://localhost/CIajax' and 'http://localhost/CIajax/' put http://localhost/CIajax/ in browser i works normally [/quote] as per my information You can use any one of them, with slash or without slash. In my case both are working properly. Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]Surrender[/eluser] [quote author="Sanjay Sarvaiya" date="1337667101"][quote author="Surrender" date="1337664995"][quote author="Sanjay Sarvaiya" date="1337663858"]make sure that in your config file Code: $config['base_url'] = 'http://localhost/Clajax'; is there any difference between 'http://localhost/CIajax' and 'http://localhost/CIajax/' put http://localhost/CIajax/ in browser i works normally [/quote] as per my information You can use any one of them, with slash or without slash. In my case both are working properly.[/quote] well. that's not the config problem . where do you usually put you jquery and css file . and how to load these files ,still blur to me .any suggestions? Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]InsiteFX[/eluser] This is wrong! The base_url should always have an ending slash on it. Code: $config['base_url'] = 'http://localhost/Clajax'; Also you should get into the habit of using lowercase directory and filenames! CI directory structure: Code: ROOT Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]Surrender[/eluser] [quote author="InsiteFX" date="1337668488"]This is wrong! The base_url should always have an ending slash on it. Code: $config['base_url'] = 'http://localhost/Clajax'; Also you should get into the habit of using lowercase directory and filenames! CI directory structure: Code: ROOT thanks research scientist my question is my config $config['base_url']='http://localhost/CIajax/'; then then my list CIajax application assets --js --images --css system index.php .htaccess then how do i load files from the from assets/js? like below? src="<?php base_url().'assets/js/jquery-1.4.2.min.js'?>" ? i would really enjoy your reply asap Unable to load jquery frustrated - El Forum - 05-21-2012 [eluser]InsiteFX[/eluser] Code: <head> You can also place your scripts at the end of your html document. |