jquery mobile - JQM: Adding click function to a button AFTER Page load via Ajax -
html:
<div data-role="page" id="main"> <a href="#" id="menubtn" class="ui-btn">menu</a> <script>$(document).on("pageshow", menu);</script> </div>
js:
function menu() { $('#menubtn').on('click', function () { ... }); alert("menu"); }
does work first pageload, after clicking link jqm loads link via ajax... menu() called, alert viewable... no click event added link
any ideas?
Comments
Post a Comment