I have the following:
var viewID = $(link).data('dialog-id')
This works when there is a dialog-id value. But when there is no value then viewID gets the value of "undefined".
Is there a way that I can make the value of viewID be equal to an empty string if dialog-id is not available or be equal to dialog-id if it is available?