Hi I am using Popups API (Ajax dialog). But it is not working it is showing an error "unable to open" in popup window after clicking on link.
Please suggest something to solve this issue.

Comments

derekwebb1’s picture

Are you compressing your javascript files at (admin/settings/performance)?

I found that normal caching and css compression is ok to use with popups api however if you turn on js compression it can have weird effects like "Unable to open: {url}" messages. For me this only happens for anonymous users. If I am logged in, the first click to a popup will work; subsequent clicks will not result in a popup and will result in the user getting redirected to the page where the popup's content actually lives. Anon. users may interact with the popup once, then the next click will send them to the parent page. At this time any further clicks to popups will result in Unable to open errors....

But the fix is simple for me: just don't aggregate js files.

Cheers.

Anonymous’s picture

Same problem here and the js is not compressed/aggregated

Xermit’s picture

I have the same problem :(
Cache page: normal
Page Compression: enable
Block cache: enable
Optimize CSS files and JS file: enable

Xermit’s picture

I found source of my freezing after second call popup window.
Last js on my site have the following command:

jQuery.getJSON( Drupal.settings.basePath + 'cart/ajax/view', null, ShowAjaxCart);

And I read the article http://www.electrictoolbox.com/jquery-json-ajax-caching/ and
http://stackoverflow.com/questions/6511350/jquery-ajax-causes-browser-fr...

I rewrote the code to

jQuery.getJSON( Drupal.settings.basePath + 'cart/ajax/view?' +  new Date().getTime(), null, ShowAjaxCart);

and

jQuery.ajax({
    cache: false,
    success: function(data) {
        // do something now that the data is loaded
        //ShowAjaxCart(data, null);
    },
    url: Drupal.settings.basePath + 'cart/ajax/view'
});

But' it's not help.

If I delete the code then popup window are open fine

I did workaround for self, I always do one call :)

if (jQuery('#ajaxCartUpdate').size() <= 0)
{
  jQuery.getJSON( Drupal.settings.basePath + 'cart/ajax/view', null, ShowAjaxCart);
}
Xermit’s picture

call $.getJSON is freezed because i use dtools WSOD module, see my comment
http://drupal.org/node/890710#comment-5343286

tomvolek’s picture

I am using the latest 6.x.2.x-dev and see the same issue , links won't open in popups.
The issue seems to be with Jquery_update installed and enabled. I need to use a later
version of jquery shipped with Drupal-6.x . As a result I had to install Jquery_update. And this is causing the popups not to show up. I am still trying to find a work around where both can co-exist.

tomvolek’s picture

Correction the issue has to do with the Jquery version I was using. going back to jquery 1.3 made the popups work.