0

先週まで、次の html を使用してユーザーを別のページにリダイレクトすることができましたが、今週の月曜日以降、このコードはガスで動作しなくなりました (caja-playground では引き続き動作するため、caja が問題の原因である必要はありません)。

なぜそれが起こったのですか?

<html>
 <body>
   <form action="www.url.com" id='redirect' method='get'>
     <input type='hidden' name='type' value='hi'>
     <script>
       document.getElementById('redirect').submit();
     </script>
   </form>
 </body>
</html>
4

2 に答える 2

2

はい、セキュリティ上の懸念から、意図的にこの機能を削除しました。私もそれが好きではありませんでした。私が開いた問題を見てください(それはすでに閉じられています)。

于 2012-10-28T03:12:49.850 に答える
0

HtmlService でリンクを作成すると、次のようになります。

<a href="?data=12">Redierect to my app"</a>

GAS は、スクリプトの URL を href の先頭に追加します。

たとえば、フォームの送信は 2 回のクリック プロセスです。

<script>
$('#btnSubmit').click(function(){
google.script.run
.withSuccessHandler(reloadDash)
.withFailureHandler(foundError)
.processWelcomeForm(this.parentNode)
  });


function reloadDash(e){
$('#btnSubmit').hide();
$('#redirectURL').show();
}

 function foundError(e){
  alert("Oops somthing broke: " + e);
  }

</script>

<html>
<form id="myForm">
<button id="btnSubmit" class="blue">Save Info</button>
<a  href="?setup=1" id="redirectURL" style="display:none">
<button id="btnSubmit" class="blue">Saved..continue on with this app</button>
</a>
</form>
于 2014-04-15T04:25:29.833 に答える