I have a simple user interface widget and I would like it to warn () "hello world !!!". upon initialization.
$.widget("ui.myWidget", {
_init: function() {
alert('Hello World!!!');
}
}
Can someone explain how this init or _init function works? if I were to call ui in the same way as in the ui dialog in $('#selector').dialog()
other words, if I click <div onclick="$('#id').myWidget()">Click Me</div>, then I should trigger a pop-up warning.
this code is short because I did not want to embed a lot of encodings into it, so it is easy to read. thank
source
share