Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide ajax requests from firebug console?

How to hide ajax requests from firebug console or anything that shows ajax calls ?

like image 831
niksmac Avatar asked Nov 22 '11 07:11

niksmac


People also ask

How do I hide XHR request?

There are few ways to "hide" them or actually make them less obvious to find; Make a JSONP request, they are not real AJAX calls, as they do not use the XMLHttpRequest object. They simply inject a script tag in the dom, the requests are still visible in the network tab.

How do I stop AJAX calls?

Just call xhr. abort() whether it's jquery ajax object or native XMLHTTPRequest object.

Are AJAX requests HTTP requests?

Ajax. Ajax is the traditional way to make an asynchronous HTTP request. Data can be sent using the HTTP POST method and received using the HTTP GET method.


1 Answers

Please, call this function after ajax success or fail:

$('.result').load('testtemplateboth/testpagetpl');
clearconsole();

function clearconsole() { 
  console.log(window.console);
  if(window.console || window.console.firebug) {
   console.clear();
  }
}

OR

$('.log').ajaxComplete(function() { 
  clearconsole();
  $(this).text('Triggered ajaxComplete handler.');
});

function clearconsole() { 
  console.log(window.console);
  if(window.console || window.console.firebug) {
   console.clear();
  }
}
like image 184
Vinoth M Avatar answered Oct 20 '22 02:10

Vinoth M