I need to be able to take any JSON data and print the key/value pairs.
(something similar to print_r() in PHP)
Is this even possible with javascript?
Adding a console log is something Google recently add. In the selected row instead of left click,click right click and select 'add logpoint', a small text box will pop up, enter the variable you want you console log.
Google Chrome: Console Logs in Chrome: In Google Chrome, the Console Logs are available as a part of Chrome Dev Tools. To open the dedicated Console panel, either: Press Ctrl + Shift + J (Windows / Linux) or Cmd + Opt + J (Mac).
I usually just quickly create a log function that allows you change the logging method. Write enablers/disablers or comment out to choose the options.
function log(msg){
if (window.console && console.log) {
console.log(msg); //for firebug
}
document.write(msg); //write to screen
$("#logBox").append(msg); //log to container
}
Update: Info on Firebug's Console API
Update: Added check for non firebug browsers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With