javascript - How to open a Dialogue Box On Page Load -
i trying open dialogue box on page load of jquery mobile screen .right able open dialogue box on button click .i want dialogue box pop automatically on page load not able it. here html..
<body onload="onload()"> <p style="display: none>you have entered: <span id="dialogoutput"></span></p> <a href="#" id="dialoglink" data-role="button" style="display: none>open dialog</a> <!-- contacts list page --> <div data-role="page" id="cont_list_page" data-theme="a"> <div data-role="header" data-position="fixed" data-tap-toggle="false"> </div> </div> </body>
and here jquery ..
function onload() { document.addeventlistener("deviceready", ondeviceready, false); $("#searchby_chooser_ok_button").bind ("click", searchbycriteria); if (typeof contact === "undefined") { getelement("contacts_list").innerhtml = "<p>the cordova contacts api inaccessible</p>"; } }
please me pop dialogue on page load not on button click event automatically. thanks
try using $(document).ready(function(){})
$(document).ready(function() { $("#simplestring").simpledialog({ 'mode' : 'string', 'prompt' : 'please enter mobile no.', 'buttons' : { 'ok': { click: function () { $('#dialogoutput').text($('#dialoglink').attr('data-string')); //get value entered //create sqlite database , table //insert there } }, 'cancel': { click: function () { }, icon: "delete", theme: "c" } } }) });
Comments
Post a Comment