我正在关注http://dev.jtsage.com/jQM-SimpleDialog/demos/string.html
使用jquery mobile创建对话框的链接我在我的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>
and in js file i have defined the following
$(document).delegate('#datalink', 'click', function() {
$(this).simpledialog({
'mode' : 'string',
'prompt' : 'What do you say?',
'buttons' : {
'OK': {
click: function () {
// var name = text($('#datalink').attr('data-string'));
//console.log("name name "+name);
alert("data was entered");
}
},
'Cancel': {
click: function () { },
icon: "delete",
theme: "c"
}
}
});
});
但是当我单击按钮打开对话框时,我收到错误消息说 $(this).simpledialog 不是函数。我在做什么错?...