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

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -