Issue with Pop-Ups Disappearing And Breaking

My site has suddenly started experiencing a strange issue which I can not seem to track or fix. My theme has a few features which open a pop-up on the screen. It appears that these pop-ups are quickly appearing and then automatically disappearing within a fraction of a second. They do not seem to "stick" on the page, and I can not figure it out for the life of me. But it is a severe problem because the primary call to action buttons are now rendered useless and confusing. Please see here for example:

Click the Inquire Now button, Schedule Tour, Share of Favorite buttons to experience for yourself. Or click the sign-in/register link in the top right menu.

Can someone please help me fix this!

  • Adam Czajczyk

    Hello Philip

    I hope you're well today!

    Did this start to happen after some update (e.g. update of the theme) or maybe a switch of the site from non-SSL to SSL?

    I'm asking because what seems to be happening is the way those "trigger buttons" are generated. each of these buttons is a HTML "a" tag so it should be a link. Clicking on it triggers some JS that in turn opens the popup.

    However, an "a" tag would usually contain some link. It's not a requirement and it doesn't have to - so sometimes such "a" tags without any links are used and that would be fine. In this case, though, it seems that "something" - and I suspect it's a theme - is putting a JS function in empty links like this:

    <a href="javascript:void();"...

    This JS seems to be causing the issue:

    - when you click on the button some popup script detects it
    - a popup is triggered but also
    - a "javascript:void()" is "executed" and that's causing CORS error, which in turn breaks popup.

    The CORS is basically a mechanisms to share resources between different servers. Since the "href" attribute of "a" tag is meant to contain a link to a resource, the CORS rules come to play. The "javascript
    :void()" - a value of the "href" attribute - doesn't include and is not a protocol prefix, doesn't include and is not a link to any resource in the same or other domain etc. This raises security issue in browser which blocks that call and breaks other JS.

    It should work on non-SSL site as there's no such tight security rules but not on HTTPS (SSL secured) site. That's why I asked about updates and/or possible swich from HTTP to HTTPS as since it worked before either there was no CORS error because there was no "javascript:void()" or that wasn't even checked due to lack of the SSL. I hope that makes some sense :slight_smile:

    That being said, I'm 95% sure that this is the issue, though I do not rule out other possible causes. But I believe this is the problem.

    Simplest way to fix that would be force those buttons ("a" tags of the buttons) to not use "javascript:void(0);" but I'm not sure where exactly these buttons are coming from.

    Could you tell me how they were added to the page? Is it some shortcode form the them or some specific settings? Is there any way/place on site where I could see an example configuration of such button?

    Best regards,

    • Philip

      I just received this response from the SiteGround hosting support:

      Thank you for your update, Philip.

      I would like to begin by saying that I have carefully reviewed all the available information on the matter and I can say that I was able to recreate the issue and spot some potential reasons for it.

      Now upon accessing the referenced in your post page, I identified CORS and Mixed Content issues, which I have now resolved by the applying the following solutions:

      Note that this restored partial functionality to your buttons as now some of them seem to work upon the initial or secondary click, however as I can see once the popup is displayed it cannot be closed.

      With this in mind, I would advise you to contact your website developer and relay this information and ask him to review the browser console for the other errors that are generated by the application itself.

      Note that it would be best this case to be further handled by a skilled developer as it now falls into a field which our scope of support does not specialize in.

      Still, if any further modifications can be made on our side, do not hesitate to contact us again.

      Note that I did not disable any plugins during this investigateion as well.

      Best Regards,
      Konstantin Atanasov
      Technical Support Team

  • Philip

    Wow, Adam, this was an extremely helpful response and insight into this issue. I have very little experience with many of the things you mentioned, however, I am very appreciative that you understand what seems to be going on here because this is one of the crucial elements of my site.

    To answer your questions; these buttons are automatically generated by my site's real estate specific WordPress theme, "HomeVillas". There is a custom post type for "properties", and these properties can be assigned to "agents". These buttons will open a contact form that links to those agent's inboxes, which is why they are so important because it is built into the functionality. I believe you would need to look at the theme's code (or the plugin that comes with the theme to power it's functionalities).

    Regarding the SSL/HTTPS aspect, I believe this could be the case. My site is hosted on Siteground and there is an option to have the site secured by HTTPS. I had this set-up but then I migrated my site over to another hosting package recently. I am not sure what the current specifications include because I am not very astute at these aspects...

    I am not sure if this is connected, however, my site has also suddenly started blocking all pop-ups created by the Popup Pro plugin I've been using from your company. It was working fine forever, but then they suddenly stopped appearing.

  • Adam Czajczyk

    Hi Philip

    Thanks for keeping me updated!

    It was a good move to get in touch with the host and it's great that they applied some additional tweak related to CORS issue.

    However, I don't think that solve the case even partially as I've been experiencing exactly the same behavior as described by Konstantin from SiteGround when I was posting my previous response here: the popup did eventually show up after 2nd or 3rd attempt with no way to close it.

    I think it's still an issue and still related to the same thing that I explained before - which, as you explained that the buttons are added by the theme, would be strictly a theme code issue.

    Have you tried to ask theme developers to check this? Specifically, to get rid of that "javascript:void();" function call from "href" attribute of links?

    Instead of it, such button link should rather be create this way:

    <a href="#" ...

    [note: I'm not posting full link HTML, just the part that needs changes, the rest should be kept as it is]

    and then in the JS code that's triggered on the click it's best to use


    function. The point of "javascript:void();" is solely to avoid page refresh and this should normally work equally well but also be more universal - not relevant to SSL/non-SSL issues and browser versions.

    In case you weren't able to contact theme developers or they were refusing assistance, let me know and I'll see how I could help you solve this.

    Where can I see Popup Pro popups on site to check them too?

    Best regards,

  • Predrag Dubajic

    Hi Philip,

    I had a look at your site but there's not much information in browser console on what could be causing this, and the issue seems to be specific to something on your site because when I recreate the same popup on my test site it works fine.

    In order to find what's causing this on your installation, it would be best to perform conflict test by disabling other plugins and switching to default WP theme to see any of these are causing this issue with Popup.

    I would, however, suggest that you try switching to Hustle plugin instead, as this is our more modern plugin that's basically Popup on steroids.
    It's also compatible with Popup, so if you install Hustle you can just disable Popup Pro and you will see your existing popup in Hustle > Pop-ups panel, it might need some color adjustments (available in plugin settings) but other than that other settings should already be there.
    Hustle also comes with MailChimp integration so there would be no need to use an additional plugin for MailChimp subscriptions.

    Best regards,

  • Adam Czajczyk

    Hi Philip

    Thank you for information and for enabling support access.

    I checked the site and it seems that there's a conflict related to the way the popups were loaded. The PopUp Pro plugin includes several ways of triggering popups - in the sense of the "scripts that make it show" and the "anonymous script" was apparently not working with that setup.

    Once I switched it to the "Page Footer" (on the "PopUp -> Settings" page) it started to work. I've checked it with two browser, in "normal" and "incognito" mode and the Membership popup was showing up after scrolling the page down by around 20%. It also worked for me with uBlock enabled so that should be fine, I think.

    I left PopUp Pro enabled on site so please take a look and check it (note please: you might need to clear browser cache) and let me know if it's working fine now.

    Best regards,

  • Predrag Dubajic

    Hi Philip,

    I was able to get a hold of the theme you're using as well as the WP Cost Estimation & Payment Forms Builder plugin, then I created new popup and new page with the form.
    However, I still had no issues with the popup showing on my site even with all of that so it seems that there's something specific on your installation that's in addition to theme and plugin causing the issue.
    Have you tried running popup only with WP Cost Estimation & Payment Forms Builder and Homevillas theme active while everything else is disabled?

    Also, did you check our Hustle plugin as it's more modern and its code is better optimized to work with different themes and plugins.
    Have you tried running popup only with WP Cost Estimation & Payment Forms Builder and Homevillas theme active while everything else is disabled?

    Hustle will also find your existing popups so most of the settings will be already there when you make the switch so it will be fairly to easy check if that will work on your site.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.