[eluser]beben[/eluser]
I want to load view using ajax,, so i call the controller in ajax,, but,, nothing changed,, i can't load the controller.. this is my code...
Code:
var x = 1;
function cek(){
$.ajax({
url: "<?php echo base_url();?>main/cekPesan",
cache: false,
success: function(msg){
$("#notifikasi").html(msg);
}
});
var waktu = setTimeout("cek()",3000);
}
$(document).ready(function(){
cek();
$("#pesan").click(function(){
$("#loading").show();
if(x==1){
$("#pesan").css("background-color","#efefef");
x = 0;
}else{
$("#pesan").css("background-color","#4B59a9");
x = 1;
}
$("#info").toggle();
//ajax untuk menampilkan pesan yang belum terbaca
$.ajax({
url: "<?=base_url();?>main/lihatPesan",
cache: false,
success: function(msg){
$("#loading").hide();
$("#konten-info").html(msg);
}
});
});
$("#content").click(function(){
$("#info").hide();
$("#pesan").css("background-color","#4B59a9");
x = 1;
});
});
Thank you...