PhantomJS: JavaScript not executing on some pages

Problem When using the PhantomJS browser to open web pages, you are faced with interesting/annoying problems. One such issue I encountered was that a custom click handler was not being executed on a specific page – while generally working on…