Problem with using jquery |
[eluser]kingmaoam[/eluser]
Hi, I have a problem with jquery. I am using the datepicker. When I initialize jquery with Code: <.script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></.script> But when I switch to my local jquery Files Code: <.script type="text/javascript" src="<?=base_url('js/jquery/jquery-1.8.0.min.js')?>"></.script> Code: ReferenceError: $ is not defined [http://feuerwehr.sarbas.net/admin/content/createEinsatz/NDUyZWU1NjczMWR:241] Has anyone had this problem before? I have addes the dots at the front of the script tags for not to have them switched to [removed] in this post. KR Habib
[eluser]Oscar Dias[/eluser]
Check the source code of the rendered view. If the SCRIPT tag has the correct SRC, then the problem is in the js's files. Otherwise could be a problem in your base_url definition in the config file.
[eluser]kingmaoam[/eluser]
Hi Base_url should be fine. Works with my CSS Files and my urls. The jquery file was downloaded from jqueryui.com and not customized.
[eluser]Samus[/eluser]
Do it like this bro. Code: <.script type="text/javascript" src="<?=base_url();?>js/jquery/jquery-1.8.0.min.js"></.script>
[eluser]kingmaoam[/eluser]
Hi, generated head tag is Code: <link rel="stylesheet" href="http://feuerwehr.sarbas.net/css/admin/layout.css" type="text/css"> Doesn't matter if I use base_url('url'); or base_url();url, it is always the same result in rendered page and datepicker not working. Any other ideas? KR Habib
[eluser]kingmaoam[/eluser]
I used firebug to debug my code and it says Code: "NetworkError: 500 Internal Server Error - http://feuerwehr.sarbas.net/js/jquery/jquery-1.8.0.min.js" I have checked the chmod for js dir, subdirs and files and it is 777 On manually opening the url http://feuerwehr.sarbas.net/js/jquery/jq...8.0.min.js the js file is displayed. any idea?
[eluser]Samus[/eluser]
[quote author="kingmaoam" date="1345372651"]I used firebug to debug my code and it says Code: "NetworkError: 500 Internal Server Error - http://feuerwehr.sarbas.net/js/jquery/jquery-1.8.0.min.js" I have checked the chmod for js dir, subdirs and files and it is 777 On manually opening the url http://feuerwehr.sarbas.net/js/jquery/jq...8.0.min.js the js file is displayed. any idea?[/quote] It isn't displayed for me. It says you need to set a default controller in your routes. Have you done that? I don't think so, because I tried to access the route of that site and it gave the same error. Anyway the best way to use jquery would be to use google's CDN anyway.
[eluser]DarkManX[/eluser]
Try to set $config['csrf_protection'] to FALSE PS: can you show ur root .htaccess pls?
[eluser]kingmaoam[/eluser]
Hi Direct Access to this URL works only when I rename htaccess because of mod_rewrite enabled. Using the hosted files works for jquery but I have another Problem with TinyMCE which also doesn't work with the local files. I will Post the htaccess when i am back at my Computer.
[eluser]kingmaoam[/eluser]
ok..... thanks for the hint with the htaccess file... There I found the problem which concerned me for about 1 week... changing RewriteCond $1 !^(index\.php|css|images|robots\.txt) to RewriteCond $1 !^(index\.php|css|js|images|robots\.txt) helps alot :-) Now my TinyMCE is working to! Yihaaa !!! :-) KR Habib |
Welcome Guest, Not a member yet? Register Sign In |