Search code examples
htmlgoogle-apps-scriptgoogle-sites

Can't have link in Embedded web app in Google site?


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 :

  1. Open https://sites.google.com and create a new site

  2. 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>
    
  3. Now testing on preview or once the site publish the link can't be clicked


Solution

  • 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>