Reputation: 2165
I'm trying to create a Google Sites webpage with a fancy css box with a hyperlink inside (along with some un-linked text). The code I have so far is:
function doGet(e){
var app = UiApp.createApplication();
var ss = SpreadsheetApp.openById('SPREADSHEET_KEY');
var sheet = ss.getSheetByName("Sheet1");
app.add(app.createHTML('<div style="font-family:Helvetica Neue,Arial,Helvetica,sans-serif;
color: rgb(255, 255, 255);font-size:18px;display:inline-block;text-align:center;
padding: 14px 0px 14px;background:rgb(51, 204, 255);min-width: 500px;
border-radius: 40px 40px 40px 40px;font-weight:bold;">'
+ 'Some Example Text' + '<a href="http://www.google.com/">My Example Link</a>' + '</div>'))
This text box will eventually contain some variables from my spreadsheet. But for now, I can't get this hyperlink to work. The observed error: The hyperlink text doesn't appear in the box. The other text in the box (in this case: 'Some Example Text') appears fine, with all the css I have definded, but as mentioned, the link doesn't show at all. And no errors in script editor.
Does anyone know what I'm doing wrong? I'll be very grateful for any help. Many thanks in advance.
Upvotes: 0
Views: 346
Reputation: 46812
from the documentation : Here is the list of HTML tags that are permitted:
B, BLOCKQUOTE, BODY, BR, CENTER, CAPTION, CITE, CODE, DIV, EM, H1, H2, H3, H4, H5, H6, HR, I, LABEL, LEGEND, LI, OL, P, SPAN, STRONG, SUB, SUP, TABLE, TBODY, TD, THEAD, TITLE, TR, TT, UL (reference)
but you can use the anchor widget to show a link
Upvotes: 1