HTML - “&” lost during evaluation process

我是研究僧i 提交于 2021-01-05 07:26:40

问题


This question is related to my previous post.

I'm trying to "build" a link to a specific range inside a Sheet. So, I'm building something like this https://docs.google.com/spreadsheets/d/1XXXXXX/edit#gid=99999999&range=A2:D2 The build is working fine but when it runs through the template and evaluate process something is lost and the "&" turns into "%E2%A6%A5". Any thoughts?


Edit1: Here's a minimal script snippet

var link = 'https://docs.google.com/spreadsheets/d/XXXXXX#gid=999999' + "&" + "&range=A" + (i + 2) + ":D" + (i + 2);

var emailtemplate = HtmlService.createTemplateFromFile('Monthly pulse check');
  emailtemplate.OOOPULSE = link;

  var emailbody = emailtemplate.evaluate();
<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <?!=OOOPULSE?>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
  </body>
</html>

来源:https://stackoverflow.com/questions/65311615/html-lost-during-evaluation-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!