0

HTML テンプレートに次のアンカーがあります。

<a href="<?!= ScriptApp.getService().getUrl() ?>"><button>All Feedback</button></a>
<a href="<?!= ScriptApp.getService().getUrl()+"&filter=bomgar" ?>"><button>Bomgar Feedback</button></a>
<a href="<?!= ScriptApp.getService().getUrl()+"&filter=tickets" ?>"><button>Ticket Feedback</button></a>

パラメータ付きのリンクに移動する場合、「&」および「=」記号は URL の %26 および %3d です。これが起こらないようにする方法はありますか?

ありがとう

4

1 に答える 1

2

URL に GET パラメーターを追加する?には、(文字の代わりに&) 文字を使用して導入する必要があります。アンパサンドは、複数の変数を追加するために使用されます。したがって、URL は次のようになります。

http://script.google.com/[.......]/exec?variable=data&otherVariable=otherData

がなかったので?、URL はサニタイズされてこれらの文字が削除されました。

私が作成したこのWeb アプリは、その違いを示しています。

<a href="<?= ScriptApp.getService().getUrl()+"?filter=bomgar" ?>"><button>Bomgar Feedback</button></a>
于 2013-02-06T20:26:27.260 に答える