javascript - jQuery Mobile data-role="header" click event not firing -
i have refresh button in header of jquery mobile app , click event not fire in browser (chrome). here code:
html
<div data-role="header" data-position="fixed"> <a id="#refresh_deals" data-role="button" data-inline="true" data-iconpos="notext" data-mini="true" data-icon="refresh"></a> <div data-role="fieldcontain" class="ui-title" data-inline="true"><input id="main_search" data-mini="true" type="search" /></div> <a id="map_btn" data-inline="true" data-mini="true" data-transition="slide" href="#gps_map">map</a> </div><!-- header -->
javascript
$(document).bind('pageinit', function() { $('#refresh_deals').on('click', function(){ console.log('refresh clicked') }); });
it's pretty simple thing have no luck it! have tried tap event , pretty else find around web. have idea going on here?
your html incorrect, try changing this:
<a id="#refresh_deals" ... />
to this:
<a id="refresh_deals" ... />
Comments
Post a Comment