• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
javascript event on controller ?

#1
[eluser]Fribos[/eluser]
Hi, i'm trying to include a javascript alert on a controller function but it seems like doesnt work. I'm just started with AJAX and JS codding.

Here is pertinent function from my view
Code:
function checkBan(){
    $.ajax({
       type: "POST",
       url: "xxxxxxxxxxxxxxxxxxxxx/fmchat/check_ban",
    });
};

setInterval (checkBan, 1500);

This is my controller function
Code:
function check_ban() {
      if ($this->session->userdata('ban')<>'') {
        ?&gt;
        <.script language="JavaScript" type="text/javascript">
           .alert('User banned');  
        </.script>
        &lt;?
      }
    }

I dont know if it's an ajax problem or just javascript is not allowed on controllers.
I'll regards every kind of tip, help or comment.
Thanks


Messages In This Thread
javascript event on controller ? - by El Forum - 11-29-2010, 02:48 PM
javascript event on controller ? - by El Forum - 11-29-2010, 02:53 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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