Reputation: 26281
I usually use firebug to troubleshoot JavaScript.
Other than inserting script like I did below, is there an easy way to view jQuery data() associated with an element using Firefox/Firebug? I am open to other tools such as Chrome if necessary.
<div id='foo' data-bar='hello'></div>
...
$('#foo').data('bar','goodby');
...
console.log($('#foo').data('bar'));
Upvotes: 3
Views: 259
Reputation: 13
Method I use is in Chrome. F12, Sources, put break point in your function, hover over the variable with your cursor to see what its passing/returning.
http://www.codeproject.com/KB/trace/BeginChromeDebug/view_watch.png
Upvotes: 0
Reputation: 3879
You can enter JavaScript into most debugging consoles; if you type in your code and press enter you will see it's output beneath, like so:
The above example is from Chrome.
Upvotes: 1