• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can't not load controller in ajax url,,

#1
[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...


Messages In This Thread
can't not load controller in ajax url,, - by El Forum - 07-16-2012, 09:50 AM
can't not load controller in ajax url,, - by El Forum - 07-16-2012, 10:16 AM
can't not load controller in ajax url,, - by El Forum - 07-16-2012, 10:41 AM
can't not load controller in ajax url,, - by El Forum - 07-16-2012, 01:02 PM
can't not load controller in ajax url,, - by El Forum - 07-16-2012, 02:12 PM
can't not load controller in ajax url,, - by El Forum - 07-16-2012, 02:57 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.