国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > JS > 正文

JavaScript如何獲取到導航條中HTTP信息

2024-05-06 16:40:14
字體:
來源:轉載
供稿:網友

本文實例為大家分享了Android九宮格圖片展示的具體代碼,供大家參考,具體內容如下

1、style中帶有注釋的部分為獲取HTTP中的信息

2、body中顯示效果為:

1)、打開頁面是自動彈出輸入提示框
2)、點擊刪除時,會有警告框彈出

   點擊確定時,刪除信息
   點擊取消時,不刪除信息

代碼

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> <title></title> <!-- JavaScript代碼 --> <script>  //  console.log("URL地址: " + window.location.href);  //  console.log("主機名: " + window.location.hostname);  //  console.log("端口: " + window.location.port);  //  console.log("主機: " + location.host); // 主機名+端口  //  console.log("協議: " + location.protocol);  //  console.log("路徑: " + location.pathname);  //  console.log("有效的寬度(單位:像素): " + screen.availWidth);  //  console.log("有效的高度(單位:像素): " + screen.availHeight);  //  console.log("每個像素顏色的位數: " + screen.colorDepth);  //  document.write("官方瀏覽器代碼名的字符串的表示:" + navigator.appCodeName + "<br/>");  //  document.write("官方瀏覽器名的字符串的表示:" + navigator.appName + "<br/>");  //  document.write("用戶代理:" + window.navigator.userAgent + "<br/>");  //  document.write("版本信息:" + window.navigator.appVersion + "<br/>");  //  document.write("瀏覽器所在的計算機的平臺:" + window.navigator.platform + "<br/>");  //  document.write("Cookie:" + window.navigator.cookieEnabled + "<br/>"); </script></head><body><script> function remove() {  var r = confirm("確定要刪除嗎?");  console.log(r); } prompt("您幾歲?");</script><table> <tr>  <th>姓名</th>  <th>年齡</th>  <th>操作</th> </tr> <tr>  <td>張三</td>  <td>19</td>  <td><input type="button" value="刪除" onclick="return remove();"/></td> </tr> <tr>  <td>李四</td>  <td>18</td>  <td><input type="button" value="刪除" onclick="return remove();"/></td> </tr> <tr>  <td>王五</td>  <td>20</td>  <td><input type="button" value="刪除" onclick="return remove();"/></td> </tr> <tr style="display: none">  <td>趙六</td>  <td>21</td>  <td><input type="button" value="刪除" onclick="return remove();"/></td> </tr> <tr>  <td>孫七</td>  <td>20</td>  <td><input type="button" value="刪除" onclick="return remove();"/></td> </tr></table></body></html>

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持VeVb武林網。


注:相關教程知識閱讀請移步到JavaScript/Ajax教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 缙云县| 扶沟县| 准格尔旗| 梁河县| 龙州县| 旬阳县| 游戏| 镇雄县| 平江县| 辽宁省| 洞口县| 肥西县| 西畴县| 盘锦市| 高要市| 东方市| 潮安县| 盐津县| 桂阳县| 宜兰市| 专栏| 墨脱县| 崇仁县| 固始县| 南靖县| 福贡县| 建德市| 嘉义县| 垫江县| 淄博市| 延边| 大田县| 通海县| 汝阳县| 吉木乃县| 成武县| 班戈县| 潜山县| 巢湖市| 阿拉善盟| 高雄市|