jquery - typeerror result of expression $(this).simpledialog [undefined] is not a function -


i following http://dev.jtsage.com/jqm-simpledialog/demos/string.html link creating dialog using jquery mobile have defined following in html

 <div data-role="popup" id="savepopup" class="ui-corner-all" style="background: url(image/popupbackground.png); background-size: 100% 100%;background-repeat: no-repeat;">     <div id="datalink">         <a href="#" data-inline="true" data-rel="dialog" ><img src="image/button.png" width="100%" height="" ></a>     </div>     </div>  , in js file have defined following     $(document).delegate('#datalink', 'click', function() {     $(this).simpledialog({     'mode' : 'string',     'prompt' : 'what say?',     'buttons' : {       'ok': {         click: function () {          // var name = text($('#datalink').attr('data-string'));           //console.log("name name "+name);           alert("data entered");         }       },       'cancel': {         click: function () { },         icon: "delete",         theme: "c"       }     }   }); }); 

but when click on button open dialog error saying $(this).simpledialog not function. what's mistake doing?..

i hope have initialized jqm-simpledialog js file because 3rd party dialog implementation, , cant found inside classic jquery mobile framework.

if need use basic dialog advise use normal jqm dialog.

basically error saying simpledialog function can't found , because not initialized.

i made working example classic jqm dialog :http://jsfiddle.net/gajotres/jx9xm/

$(document).on('pageinit', '#mainpage', function(){      $(document).on ('click','#createevent', function () {                 $.mobile.changepage('#addcatform', {             transition: 'pop',             changehash: true,             role: 'dialog'         });     });      $(document).on('click','#cancat',function () {         $('#addcatform').dialog('close');     });         }); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -