Is this the way to setup my event to call a function?
I have this in a document.ready
$(document).on('change', "[data-viewlink]",
function ()
{
UpdateViewLink($(this).attr("id"));
}
);
The UpdateViewLink() function is surrounded by a function(). It is a single call and am wondering if function(){} is required. Is this the correct way to set this up?
I also call UpdateViewLink() from normal functions.
It is required if you really want to pass the id as an argument to
UpdateViewLink.However, you may use this instead:
The id of the changed element will be available inside
UpdateViewLinkasthis.id. So it depends on whether you can modifyUpdateViewLink, or not.