Home > Back-end >  Img Src function in popup with Google Apps Script
Img Src function in popup with Google Apps Script

Time:02-13

I would to embed in my popup an image with the img src function.

How could I proceed in google apps script?

  copyDoc.saveAndClose();
  var url = "https://docs.google.com/document/d/"  copyId  "";
  var htmlString = "<base target=\"_blank\">"  
  "<h2><a href=\""   url   "\">Open Doc!</a></h2>";
  var html = HtmlService.createHtmlOutput(htmlString);
  SpreadsheetApp.getUi().showModalDialog(html, 'Very Good!')

CodePudding user response:

Something like this?

var url = "https://docs.google.com/document/d/"  copyId  "";
var htmlString = "<base target=\"_blank\">"  
"<h2><a href=\""   url   "\">Open Doc!</a></h2>"  
"<p><img src='https://www.gstatic.com/script/apps_script_1x_48dp.png' /></p>";
var html = HtmlService.createHtmlOutput(htmlString);
SpreadsheetApp.getUi().showModalDialog(html, 'Very Good!')

enter image description here

  • Related