i am calling to ajax, when the user entered the data in input, but it constantly returns 404 status

my code on my phtml file

        var typingTimer;                //timer identifier
        var doneTypingInterval = 1000;  //time in ms, 5 second for example
            if ($j('#revision').val) {
                typingTimer = setTimeout(function(){
                    //do stuff here e.g ajax call etc....
                    var valueRevision = $j("#revision").val();
                             <?php $ajaxUrl = Mage::helper('adminhtml')->getUrl('*/*/returnAjaxRevisionAction');?>
                         url: "<?php echo $ajaxUrl; ?>",
                         type: "POST",
                         data: JSON.stringify({"value": valueRevision}),
                         dataType : 'json',
                         cache: false,
                         success: function(data) {
                             console.log("SUCCESS: ", data);
                         error: function(data) {
                             console.log('ERROR: ', data);
                }, doneTypingInterval);

code on my controller

 protected function _isAllowed()
        return true;

  public function returnAjaxRevisionAction(){

my config.xml

<?xml version="1.0"?>
                        <DaniilKrok_Testing before="Mage_Adminhtml">DaniilKrok_Testing</DaniilKrok_Testing>

  • 1
    Try this getUrl('*/*/returnAjaxRevision') – pontikos Nov 2 '19 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.