Improved $.DOM.getData() method to do a hasAttribute() check first