handle null / undef check cleanly in jQuery plugin

Re-opening #173 against 4.0 branch.

jQuery plugins need to be able to handle setting content to `null` without crashing (see #173). The `==` check guards against both `null` and `undefined`.