Note that there are some explanatory texts on larger screens.

plurals
  1. POexternal js & css not loading in codeigniter
    primarykey
    data
    text
    <p>To load external Javascript file in codeignitor, I'm using </p> <pre><code>&lt;script src="&lt;?php echo base_url("application/js/contentslider.js"); ?&gt;" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>I can see in the page's source as</p> <pre><code>&lt;script src="http://localhost/cinifb_ci/application/js/contentslider.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>which means to my knowledge that the file is loading perfectly similarly for my CSS file, I've used</p> <pre><code>&lt;link rel="stylesheet" href="&lt;?php echo base_url(); ?&gt;application/css/default.css" type="text/css" /&gt; </code></pre> <p>and in the page's source code its showing as </p> <pre><code>&lt;link rel="stylesheet" href="http://localhost/cinifb_ci/application/css/default.css" type="text/css" /&gt; </code></pre> <p>which means even its loading perfectly. (on clicking the external js/css link in the source its showing <code>403 Forbidden</code>). But neither of their effects are applied on the page. No error its showing. I've loaded URL helper in controller as <code>$this-&gt;load-&gt;helper('url');</code></p> <p>and placed <code>$autoload['helper'] = array('url');</code> in autoload.php </p> <p>can you please explain me where I went wrong.</p> <p>I learn that to load external JS, we need to install jquery-codeigniter library. I've downloaded them and included the respective files into respective similar folders of my application folder. </p> <p>Now when I try to include <code>$this-&gt;load-&gt;library('jquery');</code> in my controller, its showing </p> <pre><code>An Error Was Encountered Unable to load the requested class: jquery </code></pre> <p>Hence I request you to please help me to understand why 403 Forbidden is showing when I can see its pointing to the exact location of the JS/CSS file and secondly if the installation of the jquery-codeigniter library is wrong please guide me. <br/> Note: <a href="http://ellislab.com/codeigniter/user-guide/libraries/javascript.html" rel="nofollow">http://ellislab.com/codeigniter/user-guide/libraries/javascript.html</a> didn't help me </p> <p><strong>Edit:</strong> <br/> jquery-codeigniter library i've placed in <code>system/libraries/javascript/</code></p> <p>In systems .htaccess file, I've written as </p> <pre><code>RewriteEngine on RewriteRule ^$ /index.php [L] RewriteCond $1 !^(index\.php|images|css|js|video_files|robots\.txt|favicon\.ico) RewriteRule ^(.*)$ /cinifb_ci/index.php/$1 [L] </code></pre> <p>In the view I'm writing as </p> <pre><code>$this-&gt;load-&gt;helper('url'); &lt;script src="&lt;?php echo base_url("application/js/jquery-1.8.2.js"); ?&gt;" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>In controller as</p> <pre><code>$this-&gt;load-&gt;helper('url'); $this-&gt;load-&gt;library('javascript'); $this-&gt;load-&gt;library('javascript/jquery'); $this-&gt;load-&gt;library('Jquery_ext'); </code></pre> <p>again if I look at source its pointing to correct source but still if i click external js file link, its showing <code>403 Forbidden</code> error <br/> Sorry for lengthy post :( <br/> Suggestions please ..!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload