Im using codeigniter to load a view. This view has a button to open a modal and in this modal i must load a method from another controller. To do this, i'm using ajax passing data by POST.
This is my ajax:
$('#modalView').on('shown.bs.modal', function (e){
$.ajax({
method: "POST",
url: "../ci_visualizacao/comparaGrafico",
crossDomain: true,
data: { sensor: eqrel, ajax: "1" }
}).done(function( data ) {
$(".modal-body").html(data);
$('.modal-body div:not(#chart)').hide();
});
});
This view (comparaGrafico) has a javascript to initiate a highstock chart.
So the problem is that i'm getting this error when loading the ajax:
XMLHttpRequest cannot load javascript:;. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
The entire page loads but not the javascript part.
And it is in same origin! or not? Is there another way to do this, or a solution to this problem?
thanks