Question on opening the survey result on the same window | XM Community
Skip to main content
Question

Question on opening the survey result on the same window

  • November 2, 2021
  • 2 replies
  • 14 views

Hello,
I have Page A with survey embedded using iframe and at the end of the survey I am trying to redirect to a Page B with parameter based from the survey. At the end of the survey block I added this piece of code to open Page B but that resulted in new tab so I am trying to close the Page A, so users don't get confused with the multiple tabs.
Is there a way to either open Page B on the same tab as Page A Or Open Page B in new tab and close Page A .
This is my code
Qualtrics.SurveyEngine.addOnReady(function()
{
window.open(Page B);
window.top.close(); -- this is for closing for Page A
  });

2 replies

mmoore
Level 2 ●●
Forum|alt.badge.img+9
  • Level 2 ●●
  • November 4, 2021

Try using window.location.replace(Page B) instead. This will open Page B in the current tab/window and prevent the user from using the back button in their browser to return to Page A.


  • Author
  • November 4, 2021

mmoore thanks for the response. This option actually loads the page in the iframe instead of opening it in the same tab. Page B is loaded within the Page of the iframe.