Works with iframe, but not ajax... ?!?

Hello all,

I’ve run into trouble attempting to replicate something in ajax that
worked when done with an iframe…

In both cases I have a table inside a div that is being periodically
refreshed every few seconds… The 1st column of each row in the table
contains a link to a DHTML popup menu. I have the popup menu working in
the ajax version.

The problem is that in the ajax version the popup menu disappears with
the next ajax call… Curiously, however, with the iframe implementation
of the table refresh, the popup menu layer persists through subsequent
refreshes until, as it is set up to do, the div’s visibility is reset to
“hidden” by an onmouseout event.

As the persistence/disappearance of the menu layer would seem to be a
DOM thing, I don’t understand why this behavior differs between the two
techniques.

As it’s quite important that the menu not disappear until the user has
made a choice, I could just go back to the iframe approach, but I’d like
to stay with ajax…

Any wisdom on this would be much appreciated!

Thanks.

randy marmer wrote:

Hello all,

I’ve run into trouble attempting to replicate something in ajax that
worked when done with an iframe…

In both cases I have a table inside a div that is being periodically
refreshed every few seconds… The 1st column of each row in the table
contains a link to a DHTML popup menu. I have the popup menu working in
the ajax version.

The problem is that in the ajax version the popup menu disappears with
the next ajax call… Curiously, however, with the iframe implementation
of the table refresh, the popup menu layer persists through subsequent
refreshes until, as it is set up to do, the div’s visibility is reset to
“hidden” by an onmouseout event.

As the persistence/disappearance of the menu layer would seem to be a
DOM thing, I don’t understand why this behavior differs between the two
techniques.

As it’s quite important that the menu not disappear until the user has
made a choice, I could just go back to the iframe approach, but I’d like
to stay with ajax…

Any wisdom on this would be much appreciated!

Thanks.

Hello again,

This just in from our FWIW (For What It’s Worth) Dept…

The problem I was having was due to the fact that I had the popup menu
div coded within the partial. I took it out & put it into the .rhtml
file that calls the partial & now it behaves properly, i.e., the popup
menu persists until the user does a mouseout - despite the continuing
refreshes on the table.

The lesson here is to keep the partials clean & not just toss things
(like script & style tags) in there jsut cause it seems convienient.
This kind of thing, sloopy though it may have been), was fairly (too?)
easy to get away with when coding PHP…

Hope this helps someone.