views:

22

answers:

1

Hi,

I have a firefox addon which opens a document.popup window. When I click a link within the popup, I want to call a javascript function which displays an alert within the popup itself. When I try onCLick(onY()); the alert comes only after I close the popup.

'<div id="SearchLiteDef-yahoo" style="'+
            'font-family:arial; font-size: 12px; float: left; cursor: auto; background-color: #DDD; '+
            'margin: 0 3px ' + margin + 'px; '+
            'padding: 0 3px; -moz-border-radius: 2px; width: auto;' +
            'height: ' + windowButtonHeight + 'px; '+
            'font-size: 12px; '+
            'line-height: ' + windowButtonTextSize + 'px; '+
            'font-weight: bold"><a href="#" onClick="onY(document.popupNode);" style="text-decoration: none;">Y!</a></div>'+
        ''+

This is the section which calls the popup. I want to call the function

this.onY = function(e){
alert("Hello");
}

The alert comes only when I close the popup window. I want the alert to come inside the popup window.

Thanks, Kiran

+1  A: 

I think the problem is that you try to open a popup within a popup. You can only have 1 popup at any given time AFAIK.

lithorus
Thanks for the response. Is there any reason for not being able to open a popup from within a popup in firefox?
kiran c nair
The nature of the popup is to inform you of something specific or a stopper before continuing, eg. the confirm() function. If you could have multiple popups at the same time it would ruin that. Also when you think about the document.popupNode elemnt which can only link to 1.
lithorus