0

I'm sending an ajax request to the server in a click event handler. Here's the code:

a.ajax("/manage_content/" + b, {
            data: {
                widget_id: d.data("widget-id")
            },
            success: function(e) {
                //some code
            },
            error: function(e, g, f) {
                //troubleshooting code 
                console.log("jqXHR: ", e);
                console.log("textStatus: ", g);
                console.log("errorThrown: ", f)
            }
        })

Now, this should go to domain-name/manage_content/whatever-b-is. But, it doesn't. It instead just makes a request to the domain name which comes back with a 200. Neither the success nor the error callbacks are executed. I know that the initial part of this code is executed, it goes into data and everything and then something goes wrong (silently). What could be the reason for this kind of behaviour?

I looked at other SO questions, and there's no redirection in my case. I stay on the same page and only one request goes off in the network panel (which I just described).

Edit: According to the Sources panel's Scope tab, value of b is "enable_widget".

Sindhu Shree
  • 158
  • 2
  • 11

0 Answers0