Unable to load jquery frustrated |
[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
[eluser]Sanjay Sarvaiya[/eluser]
make sure that in your config file Code: $config['base_url'] = 'http://localhost/Clajax';
[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
[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
[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
[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.
[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?
[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
[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
[eluser]InsiteFX[/eluser]
Code: <head> You can also place your scripts at the end of your html document. |
Welcome Guest, Not a member yet? Register Sign In |