0

here is my code response is 302 no found but when i check this controller directly by url it is working fine

jQuery(document).ready(function() {
            var customurl = "<?php echo $baseUrl.'admin/pricingoption/option/editfieldphtml'?>";
            jQuery.ajax({
                url: customurl,
                type: 'POST',
                dataType: 'json',
                data: { },
            complete: function(response) {    
                // console.log(response);    
                console.log('bxhgjkhgfdsfghjkhgfd');   
                },
                error: function (xhr, status, errorThrown) {
                    console.log('Error happens. Try again.');
                }
            });
        });

ADDITIONAL INFO: I am getting this error because of POST call i dont know why it is behaving like such on admin side so i have to change my ajax call to GET and it works fine

1

I am getting this error because of POST call i dont know why it is behaving like such on admin side so i have to change my ajax call to GET and it works fine

2
  • Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
    – Jarnail S
    Apr 7 '20 at 10:32
  • thanks bro its done
    – Asad Ullah
    Apr 7 '20 at 10:35
0

Add echo , exit in controller execute method. Check the ajax request is getting called or not in network in chrome browser. If its called , right click and visit the url in another tab , check if echo exit is their or not.

5

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.