I have set my url in a js file
And I have a controller called Filemanager.php
When I try click on my button which trys to launch modal. It gives the wrong location and a 404 error
The url out puts
How ever should only produce
assets > jquery > common.js
Routes.php
Any idea in how to make sure it gets the right url I cannot use base_url in a js file.
filemanager.png (Size: 14.4 KB / Downloads: 11)
Code:
assets
assets > jquery > common.jsAnd I have a controller called Filemanager.php
Code:
application
application > controllers > Filemanager.phpWhen I try click on my button which trys to launch modal. It gives the wrong location and a 404 error
The url out puts
Code:
http://localhost/project-1/question/filemanagerHow ever should only produce
Code:
http://localhost/project-1/filemanagerassets > jquery > common.js
Code:
$(document).ready(function() {
$(document).delegate('img[data-toggle=\'image\']', 'click', function() {
$('#modal-image').remove();
$.ajax({
url: 'filemanager',
dataType: 'html',
success: function(html) {
$('body').append('<div id="modal-image" class="modal">' + html + '</div>');
$('#modal-image').modal('show');
}
});
});
}); Routes.php
Code:
$route['filemanager'] = 'filemanager/index';Any idea in how to make sure it gets the right url I cannot use base_url in a js file.
filemanager.png (Size: 14.4 KB / Downloads: 11)