Posts

Showing posts from April, 2017

Debugging those JavaScripts

Image
So, you have some code that is playing up, and you want to debug them. We have a few options depending on the situation we are in. 1. Debug APEX/web app in Chrome I primarily use Google Chrome, so will be focusing on using that browser to debug. The next thing we want to do is enable a break point so that the execution will pause in you can inspect variables and step over the code line by line. Typically, in the developer tools you will want to navigate to the sources tab, find your script and add the break point. In the case of inline, I found the following interesting behaviour (unsure if its a buggy browser version or what). When I run the page for the first time, and open the developer tools, trying to open the page source will result in an empty document. However, if I re-run the page with the developer tools open, the full page source will be displayed. Another neat trick that I discovered, is that you can map inline code to a "dummy" source file, as d