Fortunately, PhoneGap supports encoding JSON out of the box:
This post has been moved here.
An outer element has children that float (for example, in a grid display). You need the outer element to stretch around the floated elements. What do you do?
Until recently, my standby was to add an extra child element after the others with the property clear: both.
This is a messy and intrusive solution because it forces you to add markup to do the job of layout. Isn’t it possible to fix this problem with CSS? Yes, it is.
Alex Walker points out that setting overflow: auto on the containing element does the trick. In code:
Post has been moved here.
As part of some experimentation with the HTML5 canvas tag, I needed a function to calculate the shortest distance from a point to a line. Here it is:
Clean and effective.