Okay, so I have a Google Site that I need to redirect to a website.
So for example, I have sites.google.com/xxx/xxx
And when people enter that, I want it to redirect to my website
www.xxxxxxxx.com
How do I do this?
Okay, so I have a Google Site that I need to redirect to a website.
So for example, I have sites.google.com/xxx/xxx
And when people enter that, I want it to redirect to my website
www.xxxxxxxx.com
How do I do this?
You could bypass this by using js to change href of some hidden element and than use javascript to "click" on this element. I've used this to create contacts search element directly on sites.
Markup
<a href="" id="searchHelper"></a>
<button onclick="functionSearch()" id="buttonSearch">
<input type="text" id="inputSearch" value="" placeholder="Search">
Javascript
function functionSearch() {
var inputSearch = document.getElementById("inputSearch");
if (inputSearch.value != "") {
document.getElementById("searchHelper").href = "https://contacts.google.com/search/" + inputSearch.value;
document.getElementById("searchHelper").click();
}
}
On App Script it's not possible.
In App Script , you can do this:
var anchor = app.createAnchor("link", "http://www.google.com");
Look the doc : => https://developers.google.com/apps-script/reference/ui/anchor
On javascript :
// click on a link
window.location.href = "http://google.com";
// redirect
window.location.replace("http://google.com");