When creating websites I often use jQuery's .data()
function to add data to elements.
Is it possible to view all data which is stored with an element in Chrome?
So when I inspect an element it shows the data in Chrome itself.
If not would it be possible to write a plugin to 'extend' to Chrome element inspector
to also show to data?
Note: To actually see a post request that reloads your page, you need to check "Preserve Log". In Chrome 71, the body (ie. POST-ed data) shows up at the bottom of the Headers tab under the "Request Payload" heading.
One simple approach is to start Chrome Developer Tools, switch to the Sources panel and hit F8 (Pause Execution). This will break on the first executed JavaScript statement.
You need to double click the variable name, then right click will reveal the add to watch option.
Open the inspector, and into the console, type
$('<some selector>').data()
and then hit return to evaluate the data()
method and show its return value directly.
There's no need to use console.log
unless you're calling it within non-interactive code.
Can be found in the Chrome Extensions Webstore and adds another tab to the properties panel in the developer tools.
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