I have a strange problem with Jquery Ajax with the following code.
Situation 1:
function leuk(decrease_id, user_id) {
$.ajax({
type: "POST",
url: 'http://schoolprove.nl/nieuw/index.php/leerlingen/checkvoortgang/',
data: 'decrease_id=' + decrease_id + '&user_id=' + user_id,
success: function (msg) {
$('#output').html(msg);
}
});
}
Situation 2
function leuk(decrease_id, user_id) {
$.ajax({
type: "POST",
url: '/nieuw/index.php/leerlingen/checkvoortgang/',
data: 'decrease_id=' + decrease_id + '&user_id=' + user_id,
success: function (msg) {
$('#output').html(msg);
}
});
}
The AJAX url works sometimes whith http:// and sometimes without. I build and error catch when a error occured. This works very well at IE but Firefox doesn't give a error. So at some computers with Firefox this will not work. It is very strange and i don't know why it will not work.
Situation 1: Works sometimes
Situation 2: Works sometimes
Sometimes situation 1 works and ad a other computer situation 2 works, WHY? Anybody know how to solve?
Thank you very much!!
http://it does not work? Because this will be cause by browser security. You can not perform AJAX cross domain therefor you have to use a relative path such as/something,./somethingor../something.