Hide Firebug ajax calls

Finally i got some time to post a new post. I have been thinking how can I ajax calls from being displayed in firebug console.

I can sound foolish being a developer I never read about firebug api, used firebug addon for best of my development practices.

In the api there is an api function for firebug,

 

 

 

1
2
3
4
5
6
7
8
// detect if firebug is open


if (window.console || window.console.firebug) {
console.clear(); // clear the console

}

You can use this after every ajax call example.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// create a function


function clearConsole()

{

if (window.console || window.console.firebug) {
console.clear(); // clear the console

}

}

jQuery.ajax({
type: "GET",// can be GET OR POST

url: urlx,
cache: false,
error: function()
{
alert('error try again!!'); // show error or whatever

clearConsole();// call the function

},
success: function(html)
{
clearConsole();
//--- you code----

}
}
});

 

as you can see the function has been called on error as well as on success, since you would need to hide the call even when there is an error.
Creating a function would make it easy for you to comments the things at the time of development.
Try At Js Fiddle

3 comments

Post a comment

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>