views:

553

answers:

2

I have a page that has 3 buttons on it, when a user clicks on a button it displays a model popup where the user inputs data etc.

On the main page there is a dropdownlist which breaks through the model when it popups up, this is a known IE6 z-index bug.

My workaround (after trying bgiframe) was to simply hide the dropdown whenever a popup was visible. It works just fine.

The main page also has a button below the dropdown, that when clicked, performs a ajax postback that sends the value of the selected item to the database.

For some reason, AFTer the user clicks on that button, my javascript (jquery) stops working. Any ideas why it is screwing up my js code? firebug doesn't report any errors. Sending alert('blah') on the events stop workign after the postback (ajax postback, not entire page refersh).

What could be the cause of this?

+1  A: 

Could it be associated with your initialization hookups? Recently read an article about the difference between document.ready and pageload that might help.

Essentially the problem may be that you are wiring events up to elements, and then after the AJAX update your elements have actually been replaced, and therefore need the events to be re-wired.

Chris Shaffer
I am using $(document).ready(function(){ } currently, can it still be the reason?
Blankman
ok that seems to be the problem, so I have to add both read() and pageload. seems like allot of repeat code!
Blankman
A: 
  1. Can you post any source or a URL?
  2. After your AJAX, to you make any calls to location.href (e.g. set a hash or anything)
scunliffe