溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

JavaScript如何獲取到導(dǎo)航條中HTTP信息

發(fā)布時間:2020-08-28 11:56:03 來源:腳本之家 閱讀:124 作者:人走丿茶涼 欄目:web開發(fā)

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

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("協(xié)議: " + location.protocol);
  //  console.log("路徑: " + location.pathname);

  //  console.log("有效的寬度(單位:像素): " + screen.availWidth);
  //  console.log("有效的高度(單位:像素): " + screen.availHeight);
  //  console.log("每個像素顏色的位數(shù): " + 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 >
  <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>

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持億速云。

向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI