Welcome Guest, Not a member yet? Register   Sign In
Using AJAX to load controller?
#3

[eluser]me_not_you[/eluser]
hi,

I had the same probleme, I was using scriptaculous + prototype like so =>

Code:
[removed][removed]

[removed][removed]
[removed]
    if (!XMLHttpRequest) {
          window.XMLHttpRequest = function() {
        return new ActiveXObject('Microsoft.XMLHTTP');
          }
    }
    function startLoading() {
          Element.show('mainAreaLoading');
          Element.hide('mainAreaInternal');
    }
    function finishLoading() {
          Element.show('mainAreaInternal');
         setTimeout("Effect.toggle('mainAreaLoading');", 1000);
    }
    function loadContent(id) {
          startLoading();
          new Ajax.Updater('mainAreaInternal', '<?php echo(base_url().'index.php/manifestation/getone/'); ?>'+ id, {
            evalScripts:true,
            method: 'post',
            postBody:'content='+id,
              onComplete: function() { finishLoading();}
        });
        finishLoading();
    }
    function loaduser(id){
        startLoading();
        new Ajax.Updater('mainAreaInternal','<?php echo(base_url().'index.php/admin/getoneshow/');?>'+id, {
            evalScripts:true,
            method: 'post',
            postBody:'content='+id,
              onComplete: function() { finishLoading();}
        });
        finishLoading();
    }
    
    function loadcomparer(id){
        startLoading();
        new Ajax.Updater('mainAreaInternal','<?php echo(base_url().'index.php/manifestation/getlastyearsmanif/');?>'+id, {
            evalScripts:true,
            method: 'post',
            postBody:'content='+id,
              onComplete: function() { finishLoading();}
        });
        finishLoading();
    }
[removed]

With Firefox it works great but with IE if I call a /contoller/method => nothing

So now i'm using jquery like so

Code:
[removed][removed]

[removed]
    function get_manif(manif_id){
        showLoading();
        $('#mainAreaInternal').load('<?php echo(base_url().'index.php/manifestation/getone/'); ?>'+manif_id);
        
        hideLoading();
    }
    
    function get_user(manif_id){
        showLoading();
        $('#mainAreaInternal').load('<?php echo(base_url().'index.php/admin/getoneshow/'); ?>'+manif_id);
        
        hideLoading();
    }
    
    function showLoading(){
        //$('#mainAreaInternal').css({visibility:"hidden"})
        $('#loading').css({visibility:"visible"})
        $('#loading').css({opacity:"1"})
        $('#loading').css({display:"block"})
    }
    
    function hideLoading(){
        //$('#mainAreaInternal').css({visibility:"hidden"})
        //$('#mainAreaInternal').css({visibility:"visible"})
        $('#loading').fadeTo(1000, 0);
        
    };
[removed]

now it works great with Firefox and IE...the only thing is you cant call the javascript function again...

Hop this helps...


Messages In This Thread
Using AJAX to load controller? - by El Forum - 05-31-2009, 09:29 AM
Using AJAX to load controller? - by El Forum - 05-31-2009, 10:48 AM
Using AJAX to load controller? - by El Forum - 06-02-2009, 06:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB