Reputation: 589
I'm trying to integrate a google script app deployed as a web app in a Google Site. The embedding feature works well and all seems good at first. But for some reason links don't work in the embedded view. I can't find any specific topics about this.
Google Script web app can be embedded everywhere I tried except in Google Site. And Google Site can embed every site that allow it except web app from google script.
EDIT (2)
Turn out the problem can be resolved pretty quickly :
Open https://sites.google.com and create a new site
Insert an "embed" choose the "embed code" option and copy paste this code :
<!DOCTYPE html>
<html>
<body>
<div>
<a href="http://google.com">Click Me!</a>
</div>
</body>
</html>
Now testing on preview or once the site publish the link can't be clicked
Upvotes: 9
Views: 2202
Reputation: 391
FYI: I tried target="_self" and could not get it to work. The below is currently working for me. In our use we have the text link and an image as an icon for the href. Please note the scriplet is the URL. target="_blank" and with rel="noopener noreferrer" seems to have made the difference. I didn't delve too far into why but this article seemed to proved better explanation than other documentation I reviewed: https://pointjupiter.com/what-noopener-noreferrer-nofollow-explained/
<a target="_blank" href=<?=edGoogleDriveId?>><img src='google-drive.png' alt="Google Drive icon" rel="noopener noreferrer" class='icon';/>Employee folder</a>
Upvotes: 0
Reputation: 589
You have to specified the target propriety. Google script dont apply it by default so use this code :
<!DOCTYPE html>
<html>
<body>
<div>
<a target="_self" href="http://google.com">Click Me!</a>
</div>
</body>
</html>
Upvotes: 6