1

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

EDITED CONSOLE ERROR enter image description here

Naim Malek
  • 1,186
  • 1
  • 11
  • 21

2 Answers2

1

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.

DFriend
  • 8,869
  • 1
  • 13
  • 26
0

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');
Shiva Manhar
  • 673
  • 8
  • 19