Reputation: 21
Hello friends I'm having problems trying to use some functions that I have in two .js file. I already tried putting base_url(); and the location of the file, I also added the 'url' in the config.php
<script type="text/javascript" src="<?php echo base_url();?>js/pdf.js" ></script>
<script type="text/javascript" src="<?php echo base_url();?>js/pdf.worker.js" ></script>
I have the file in folder called: js
ERROR I GET ON THE GOOGLE CHROME CONSOLE:
GET http://[::1]/registro/js/pdf.worker.js net::ERR_ABORTED
Upvotes: 1
Views: 485
Reputation: 703
Edit /application/config/config.php file
Remove this line$config['base_url'] = '';
Rdd this code in config.php file
$root = "http://".$_SERVER['HTTP_HOST'];
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']), "", $_SERVER['SCRIPT_NAME']);
$config['base_url'] = $root;
Edit /application/config/autoload.php file.
$autoload['helper'] = array('url');
Upvotes: 0
Reputation: 8964
The request http://[::1]
points to a common error - $config['base_url']
MUST be set correctly. An empty string will not work. The entry in /application/config/config.php
should look something like this.
$config['base_url'] = "http://example.com/";
Note the protocol http://
and a trailing /
must be included.
Upvotes: 1