Support » Developing with WordPress » WordPress Ajax Search getting status of 400 (Bad Request)

  • I have created a search form to contain several text-fields, select-drop-downs and checkboxes. The output is a table below the search form. I want it to search on each click, onchange, or keyup via AJAX. I had this working as a straight PHP application. As I moved the code to WordPress trouble developed.

    When doing it the WordPress-way I get “Failed to load resource: the server responded with a status of 400 (Bad Request)” and can’t seem to locate the cause. When I call the code to process the ajax POST and echo the result. It shows up on the page correctly EXCEPT that there is a second WP menu between the form and the results table.

    I have cut the code down from a full application to a simple form/plugin that searches and displays WP’s user’s table.

    How can I better troubleshoot the “bad request?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Perhaps review the Plugin Handbook chapters on AJAX to be sure you are following the recommended methods?

    Post you JavaScript/jQuery code that sends the AJAX request. Maybe someone here will be able to spot a discrepancy.

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress Ajax Search getting status of 400 (Bad Request)’ is closed to new replies.