JavaScript如何獲取到導(dǎo)航條中HTTP信息
本文實(shí)例為大家分享了Android九宮格圖片展示的具體代碼,供大家參考,具體內(nèi)容如下
1、style中帶有注釋的部分為獲取HTTP中的信息
2、body中顯示效果為:
1)、打開(kāi)頁(yè)面是自動(dòng)彈出輸入提示框
2)、點(diǎn)擊刪除時(shí),會(huì)有警告框彈出
點(diǎn)擊確定時(shí),刪除信息
點(diǎn)擊取消時(shí),不刪除信息
代碼
<!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("主機(jī)名: " + window.location.hostname); // console.log("端口: " + window.location.port); // console.log("主機(jī): " + location.host); // 主機(jī)名+端口 // console.log("協(xié)議: " + location.protocol); // console.log("路徑: " + location.pathname); // console.log("有效的寬度(單位:像素): " + screen.availWidth); // console.log("有效的高度(單位:像素): " + screen.availHeight); // console.log("每個(gè)像素顏色的位數(shù): " + screen.colorDepth); // document.write("官方瀏覽器代碼名的字符串的表示:" + navigator.appCodeName + "<br/>"); // document.write("官方瀏覽器名的字符串的表示:" + navigator.appName + "<br/>"); // document.write("用戶(hù)代理:" + window.navigator.userAgent + "<br/>"); // document.write("版本信息:" + window.navigator.appVersion + "<br/>"); // document.write("瀏覽器所在的計(jì)算機(jī)的平臺(tái):" + window.navigator.platform + "<br/>"); // document.write("Cookie:" + window.navigator.cookieEnabled + "<br/>"); </script> </head> <body> <script> function remove() { var r = confirm("確定要?jiǎng)h除嗎?"); 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>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
bootstrap提示標(biāo)簽、提示框?qū)崿F(xiàn)代碼
這篇文章主要為大家詳細(xì)介紹了bootstrap提示標(biāo)簽、提示框的實(shí)現(xiàn)代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-12-12ionic實(shí)現(xiàn)可滑動(dòng)的tab選項(xiàng)卡切換效果
這篇文章主要為大家詳細(xì)介紹了ionic實(shí)現(xiàn)可滑動(dòng)的tab選項(xiàng)卡切換效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-08-08JS調(diào)用打印方法設(shè)置頁(yè)眉頁(yè)腳的實(shí)例
一個(gè)網(wǎng)頁(yè)打印相關(guān)功能的擴(kuò)展演示特效,在實(shí)現(xiàn)了打印功能外,還實(shí)現(xiàn)了打印預(yù)覽、打印前的頁(yè)眉頁(yè)腳設(shè)置,直接打印等功能,以前對(duì)JS打印前設(shè)置頁(yè)腳見(jiàn)的不多,所以這一個(gè)也算是挺有價(jià)值的,希望閑暇時(shí)參閱2013-05-05基于layui輪播圖滿(mǎn)屏是高度自適應(yīng)的解決方法
今天小編就為大家分享一篇基于layui輪播圖滿(mǎn)屏是高度自適應(yīng)的解決方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-09-09十個(gè)你必須要會(huì)的TypeScript技巧分享
學(xué)習(xí)Typescript通常是一個(gè)重新發(fā)現(xiàn)的過(guò)程。這篇文章為大家整理了十個(gè)你必須要會(huì)的TypeScript技巧,希望對(duì)大家學(xué)習(xí)TypeScript有所幫助2023-06-06js change,propertychange,input事件小議
github上關(guān)于mootools一個(gè)issue的討論很有意思,所以就想測(cè)試記錄下。感興趣的可以點(diǎn)擊原頁(yè)面看看2011-12-12JavaScript實(shí)現(xiàn)的聯(lián)動(dòng)菜單特效示例
這篇文章主要介紹了JavaScript實(shí)現(xiàn)的聯(lián)動(dòng)菜單特效,涉及javascript事件響應(yīng)及頁(yè)面元素屬性動(dòng)態(tài)操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2019-07-07