• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
base_url() codeigniter 3.0.4 duplicate in URL with javascript

#2
your script is in a file with extension php or js ?

because <?php ... ?> can work only on php files Smile

for me, before insert all my JS scripts in my template, i write this little code

PHP Code:
<script>
    var 
BASE_URL "<?php echo base_url(); ?>";
<
script>

<
script type="text/javascript" src="file1.js" />
<
script type="text/javascript" src="file2.js" />
<
script type="text/javascript" src="file3.js" />
..... 

BASE_URL will be available in all your JS files
Reply


Messages In This Thread
RE: base_url() codeigniter 3.0.4 duplicate in URL with javascript - by keulu - 03-08-2016, 08:14 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.