click event not binding on android
When I try to bind a click event to a list item using the following javascript:
- $('body').live('pagebeforecreate', function() {
- $('#session1').click(function() {
- $.ajax({
- 'url' : '******' + $(location).attr('href').split('?')[1].split('=')[1],
- 'success' : function(data) {
- alert(JSON.stringify(data));
- }
- });
- })
- });
The event handler isn't bound until I refresh the page on an android device. It binds the first time the page loads on computer browsers and iOS devices. I was wondering if anyone knew what could possibly be going on. I have tried including this javascript in the head and at the end of the body but to no avail. If anyone could clue me in on what I have to do that would be great.