jQuery: add a check for jQuery.val.fn

Fixes #105