Welcome Guest, Not a member yet? Register   Sign In
How to use base_url() in js file
#1

[eluser]keld[/eluser]
Hi, I'm trying to use base_url() into a javascript file that I've renamed .js.php because I'm making an ajax request like this:
Code:
...
var qt=$(this).find('select[name=fieldname]').val();
$.post(<?php echo base_url(); ?>.'/admin/dashboard/getStuff', {var: qt, ajax:'1'},...
...

How do I make the base_url accessible from here? I can add this at the top of my myscript.js.php file
Code:
$this->load->helper('url');

The problem is that my js folder is outside the application folder.

Thanks a lot!


Messages In This Thread
How to use base_url() in js file - by El Forum - 01-27-2010, 03:40 PM
How to use base_url() in js file - by El Forum - 01-27-2010, 03:59 PM
How to use base_url() in js file - by El Forum - 01-27-2010, 04:12 PM
How to use base_url() in js file - by El Forum - 01-27-2010, 04:15 PM
How to use base_url() in js file - by El Forum - 01-27-2010, 04:39 PM
How to use base_url() in js file - by El Forum - 01-27-2010, 04:46 PM
How to use base_url() in js file - by El Forum - 01-27-2010, 05:11 PM
How to use base_url() in js file - by El Forum - 01-27-2010, 05:15 PM
How to use base_url() in js file - by El Forum - 01-30-2010, 02:18 AM
How to use base_url() in js file - by El Forum - 02-02-2012, 06:44 AM
How to use base_url() in js file - by El Forum - 02-02-2012, 07:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB