Javascript/jQuery Debugging Tips

These are just some debugging tips that I always forget how to do, so I am writing them down here!

Testing your selectors 

In the browser console you can use jQuery to check the selectors you are using come back with the right thing! E.g.


(Find what’s in the ‘a’ tag within this class or id)

What’s Coming Back in an Ajax Call?

To view what you have been sent from the server
Go to the dev tools in your browser, click on network tab, click on the relevant ajax link, then choose preview.
What is this thing?
Get the selected element
If you select an element in the browser, in the console you can access it with

If you then call


It will return every attribute/property of that element.


More Chrome Tips

For lots more tips and tricks, check this out.

Leave a reply