Thu Jan 10, 2013 12:17 pm
<html>
<head>
<title>Using firebug with JQuery</title>
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<script>
$(document).ready(function(){
$("button#btn1").click(function(){
$.enableConsole = false;
$.fn.console = $.console = function(method){
if (window.console && console[method] && $.enableConsole)
console[method].apply(this, [].splice.call(arguments,1))
return this;
}
// See console
$.enableConsole = true;
// calling firebug functions, here we use console functions
$.console('debug', 'Am debuging my code with firebug', 'debugging');
// Use firebug console chain function easily:
var color = 'yellow';
$('#divEnd').css('color', color).console('log', 'Setting font color to ', color);
// And the access to the other functions time and timeEnd
$('#divEnd').console('time', '1000').animate('message').console('timeEnd', '3000');
});
});
</script>
</head>
<body>
<div id="divEnd" style="background:#0414F4;color:white;width='100';">Content Here.</div>
<button id="btn1">Start Using Firebug</button>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.