I started learning Jquery mobile, I followed this http://dev.jtsage.com/jQM-SimpleDialog/demos/string.html. Nothing happens when I click the button. The code I wrote is :
<link rel= "stylesheet" href= "http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
<script src= "http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script src= "http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
<script type="text/javascript">
$(document).delegate('#simplestring', 'click', function() {
$(this).simpledialog({
'mode' : 'string',
'prompt' : 'What do you say?',
'buttons' : {
'OK': {
click: function () {
$('#dialogoutput').text($('#dialoglink').attr('data-string'));
}
},
'Cancel': {
click: function () { },
icon: "delete",
theme: "c"
}
}
})
})
</script>
Then within the body I wrote :
<p>You have entered: <span id="dialogoutput"></span></p>
<a href="#" id="dialoglink" data-role="button">Open Dialog</a>
Could you please point to my error? Maybe in the header ? I have to learn jquery mobile because I wrote a dialog box in javascript that won’t show up in my Webapp. I read that the SimpleDialog in JQM aims to be a replacement for javascript dialog().
This works fine for me: