Why substring “com.” in GoogleScript convert to “(class)”

柔情痞子 提交于 2019-12-24 20:16:51

问题


Today, the Google script has stopped representing the line normally. In case of occurrence of a line "com." or "org." - substring is replaced by a certain class "(class)". How to fix the problem?

function myFunction2() {
   var t = "testcom.io";
   t = t + '1';
   t=t;
}

screenshot from editor https://i.stack.imgur.com/hldbz.png

The logger shows the result as well as you do. But during the debugging, the value of the variable T changes. Because of this error, URL Feth does not work. A full script was written a few months ago and worked until today.

You can look error on the next screenshot. We have var url = 'api.intercom.io';; When we try run function we see

error 406

and message where var url is changed to api.intercom.io';. In case of occurrence of a line "com." or "org." - substring is replaced by a certain class "(class)" or symbols .

function myFunction3() {
  var url = 'https://api.intercom.io';
  var response = UrlFetchApp.fetch(url,options);
  Logger.log(response.getContentText());
}

look at screenshot


回答1:


I think that test(class) is not the value of t rather that's the class to which this particular t variable belongs.

You can turn your function into something like this :

Then check the log to see value of t

Let me know if you need anymore help.



来源:https://stackoverflow.com/questions/49273513/why-substring-com-in-googlescript-convert-to-class

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