2025年4月4日 星期五

查詢2025英文營

 <html>

<head> <meta charset="UTF-8" /> <script type="text/javascript"> function showHint(str) { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var result = xmlhttp.responseText; var obj = JSON.parse(result);//解析json字串為json物件形式 var html = '<table border=1 width=100%>';// for (var i = 0; i < obj.length; i++) {// html += '<tr>';// for (j = 0; j < obj[i].data.length; j++) { html += '<td>' + obj[i].data[j] + '</td>'; } html += '</tr>'; } html += "</table>"; document.getElementById("order_status").innerHTML = html; if (obj.length == 1) //只有一筆代表查不到資料 alert('查無資料'); } } var url = "https://script.google.com/macros/s/AKfycbz79YAAB12HpxjDUB92uX6d0bAf2LF3k35IZRluHi8g-xVZnG-nzaibEAH6NW0BXSKq/exec"; xmlhttp.open("get", url + "?uid=" + encodeURIComponent(str), true); xmlhttp.send(); } </script> </head> <body> 輸入手機號碼:<input type="text" id="uid" /> <input type="button" name="inq" value="查詢" onclick="showHint(uid.value);"></br> <span id="order_status"></span> </body> </html>

沒有留言:

張貼留言