Variables, Passing Parameters, and Functions
Hey guys,
I am working on an app and have reached a standstill on somthing I thought would be simple. I need to access a variable that I am setting from a click/tap event in a pagebeforehide event. Am I insane? Is this impossible?? See below:
- $('.list_title').live('tap click', function(event) {
- listID = $(this).attr('id').replace('list-', '');
- //setting the listID here when a user clicks. want to use it later.
- });
- $('#add_list, #erase_all').live('pagebeforehide',function(event, ui){
- alert(listID);
- //always comes back undefined. What the heck? What am I doing wrong?
- });
Any thoughts on how I am doing this wrong?
Even declaring the variable as "global" (not stating 'var') does not allow this variable to be accessed. Any help would be greatly appreciated!