Google Apps Script で、https
で
以下のような
if(url.startsWith('https')) { // https の場合の処理.. } else { // http の場合の処理.. }
関数が
TypeError: オブジェクト https://www.monotalk.xyz/blog/google-apps-script-logger%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA-betterlog%E3%82%92%E4%BD%BF%E3%81%86/ で 関数 startsWith が見つかりません。(行 57、ファイル「update-amp-cache」)
以下、
現在(2017/08/08)の
javascript - String starts with in Google Script - Stack Overflow
実装は、
if(url.indexOf('https') == 0) { // https の場合の処理.. } else { // http の場合の処理.. }
以上です。
コメント