GASでポップアップブラウザを作りたいと思っています。
ローカルのapiにpostしレスポンスを得たいのですがうまくpostができず、写真の画面で止まってしまいます。
api側はrequestを受けている様子はないので、postがまず機能していないと考えられます。
どんなアドバイスでも頂けたら嬉しいです!
I'm trying to create a pop-up browswer in GAS. What I wanna do here is post some value to my local api and get response from it. My code below doesn't work as I meant to and it's stuck in the screen in the picture. Api doesn't get any request meaning post is not working successfully. Any advice will be appreciated.
GAS
1if (cell_tick == true) { 2 var tick_row = cell_pos.getRow(); 3 var date = new Date(); 4 sheet.getRange(tick_row, date_column).setValue(date).setNumberFormat('yyyy/MM/dd H:mm:ss'); 5 6 openTab() 7 function openTab() { 8 var js = "<script language='JavaScript'>\ 9 function openWindow()\ 10 {\ 11 myWindow = window.open('about:blank','theWindow','width=400,height=400');\ 12 }\ 13 </script>\ 14 <form method='POST' name='myForm' action='http://127.0.0.1:5000/' target='theWindow'>\ 15 <input type='text'>\ 16 <input type='button' onERASETHISClick='openWindow(); document.myForm.submit()' value='Open and after submit'>\ 17 </form>;\ 18 " 19 var html = HtmlService.createHtmlOutput(js) 20 //.setHeight(10) 21 //.setWidth(100); 22 SpreadsheetApp.getUi().showModalDialog(html, 'Now loading.'); 23 } 24 }
回答2件
あなたの回答
tips
プレビュー