问题
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