How to make ajax call on same page ajax request send and get in same page

here is ajax code i’m implement this code i want to call ajax request same page where i want to get the request mean same page send request and get request

 function data(status)
{    $.ajax({
      type:"post",
      url:"main.php",
      data: "status="+ status,
      success:function(data)
      {

      } }); });

i’m try this code but have problem in ajax call same html page show header footer also result how to call on self page where is ajax code how it is possible?

You’d need to wrap all the content of the two alternatives in an if/else and test for whether the page has been called by AJAX or not (presumably by passing something for the AJAX call that doesn’t normally get passed to the page.

A far simpler solution is to just keep the two pages separate and include any common processing in both.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.