Monday, August 11, 2014

cURL & SSL certificates error

This will be mainly a reminder, more than a real post.
Today I was writing a bunch of PHP bugs and suddenly a wordpress plugin of mine started to output this string :

SSL certificate problem: unable to get local issuer certificate

The plugin is quite simple itself. It just uses cURL to fetch some Facebook Pages data using the Graph urlon a Wordpress website I'm creating. The error log did not show anything about this error.

Saturday, August 9, 2014

jQuery prevent event propagation and stopEventPropagation explained

Yesterday I was implementing (AGAIN) a custom dialog-popup box for a wordpress theme so I choose to go for a javascript class to handle all the stuff, with the help of jQuery.

 While writing the close dialog code I fell in a black out moment and I wasn't able to remember what was the name of the jQuery function to prevent click propagation from childrem DOM elements to parent. Of course my (perfectly looking) dialog was firing the onClick event of the parent even when the dialog content was clicked.

While doing my usual jQuery website digging I found that a lot of people struggle with the problem of click propagation, even if the jQuery library has a stopPropagation function that SOUNDS perfect for that task....but...