考虑以下网址:
https://script.google.com/macros/s/MacroName/dev?theArg="69.28.15.332"
重要的部分在结尾:
?theArg="69.28.15.332"
我正在尝试通过URL将信息传递给应用脚本。
为什么我的.gs
谷歌应用脚本函数无法获取URL末尾字符串的值?这是doGet(e)
函数。
function doGet(e){
var passedInIP = e.parameter.theArg;
Logger.log(passedInIP);
if (passedInIP === "69.28.15.332")
{
return HtmlService.createHtmlOutput("<h2>something</h2>")
}
};
我在浏览器中看到这个错误信息:
脚本执行完毕但没有返回任何内容
Logger.log
确实记录了一些东西。它记录了[日期 时间 EDT]“69.28.15.332”
, 并且该值在日志中与我要检查的值完全相同。但是等式测试失败。