[eluser]obay[/eluser]
[quote author="Đaяк Đaηтє" date="1264843123"]Is no possible to use base_url() directly in js file... maybe this can be helpful:
Code:
//myjsfile.js.php
header ("content-type: text/javascript; charset: UTF-8");
var base_url='<?php echo base_url() ?>';
....
But i´m not completly sure....[/quote]
You can't do that because the .js.php is saved outside the application/ folder wihle the base_url() is inside the application/ folder hence it can't find the base_url() helper.
I tried moving the .js.php file inside the application/views/ folder, but it still doesn't work. Trying to access the .js.php in there gives "Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server."
Any ideas, anyone?