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

2 Answers 2

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

0
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
  • already checked ajax call through 302 not found and URL shows data Commented Apr 7, 2020 at 6:14
  • read the question already told these checks Commented Apr 7, 2020 at 6:17
  • Try in different browser. Or refer here for code reference -magento.stackexchange.com/questions/158541/… Commented Apr 7, 2020 at 6:19
  • already checked that answer let me change the browser Commented Apr 7, 2020 at 6:32
  • Also take a look at the log files , if there is any error. Commented Apr 7, 2020 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.