Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to create a mobile-friendly pop-up that allows people to click on a link in a Qualtrics survey that opens a new window that takes them to an external site. Once they are on the external site, they are able to return to the original site. What would be the best way to achieve this? I've looked into modal iFrames and those are problematic because there are some external sites that I want to feature in pop-up windows that do not allow themselves to be embedded into iFrames. I'm hoping that I can add some sort of banner that allows a user to close the pop-up window to take them back to the original site.

What I have tried:

HTML
<pre><script>
function popup() {
    var win = window.open("https://www.npr.org/2020/09/08/910707527/tech-stocks-are-in-a-mood-and-theyre-dragging-the-market-down-with-them", "Page Title", "toolbar=no, location=no");
    var win_timer = setInterval(function() {   
      if(win.closed) {
          jQuery("#NextButton").click();
          clearInterval(win_timer);
      } 
      }, 100); 
}
</script>
<a href="javascript:void(0)" onclick="popup()">Open Me</a>
Posted
Updated 9-Sep-20 22:31pm

1 solution

If a site doesn't allow itself to be embedded in an <iframe>, then there's no way you can add a "decorator" to it to take you back to your site.

The closest you can get is to open the site in a new tab. When the user closes that tab, your site will still be open in the other tab.
HTML
<a href="https://......." target="_blank">Open Me</a>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900