The CreatorCon Call for Content is officially open! Get started here.

Redirecting to external website from UI page

tapiosilveracue
Kilo Explorer

Hi all. I'm trying to set an automatic redirect from a UI page to a site outside of our SNC instance.

The redirect URL will differ according to the parameters of the UI page.

The parameters are stored in the variable sysparm_number.

This is what I have tried, but I'm only getting a blank frame.

Can anyone help me figure out what's wrong.

Processing script of the UI Page:


redirectTo();

function redirectTo() {

  var url;

  if(jelly.sysparm_number==1){url="http://www.site1.com";}

  else if(jelly.sysparm_number==2){url= "http://www.site2.com";}

  else if(jelly.sysparm_number==3){url="http://www.site3.com";}

  else if(jelly.sysparm_number==4){url="http://www.site4.com";}

  response.sendRedirect(url);

}

-Tapio

8 REPLIES 8

Kalaiarasan Pus
Giga Sage

Tried ?



window.location.href


ahaz86
Mega Guru

either of these should work for you


Similar behavior as an HTTP redirect


window.location.replace("http://yoursite.com");



Similar behavior as clicking on a link


window.location.href = "http://yoursite.com";


This works great! Is there a way to open in a new tab or window?


you could use window.open("http://yoursite.com")