Monday 5 November 2012

Ajax call in magento


url: $this->getUrl(/modulename/controllername/functionname);

new Ajax.Request(url, {
          method: 'post',
          parameters: { q: qty,
pid: itemid,
flag:flag
},
          onComplete: function(req) {      

                if(req.responseText == 'n')
                {
                    alert('Invalid Request');
                }else{

                    $('divloader').innerHTML = req.responseText;
                }
          }
        });