I am using dialog box, which I am closing when a user click anywhere on page expect that dialog box.
Here is my code:
$('body').on('click','.ui-widget-overlay',function()
{
$('#myRateSettingsPopup').dialog('close');
});
Somehow its returning an error:
$(...).on is not a function
What is wrong with my code ?
I am using jquery-1.6.1.min.js , but I cannot update it to the latest version. I am bound.
Is there any other way to do this ?
As jquery 1.6.1 is not supporting
on
so you can uselive
The replacement for .on() in jQuery > 1.4.2 is delegate()
Try
live
instead ofon
its a jquery version problemMethod on was introduced in jQuery version 1.7.
I think you have to upgrade your jQuery library to the newest version.
Otherwise, you can use bind:
jquery-1.7 jqueryui/1.8.2 perfect.
or your overlay