JavaScript如何获取到导航条中HTTP信息

所属分类: 网络编程 / JavaScript 阅读数: 218
收藏 0 赞 0 分享

本文实例为大家分享了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>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

更多精彩内容其他人还在看

浅谈Koa2框架利用CORS完成跨域ajax请求

这篇文章主要介绍了浅谈Koa2框架利用CORS完成跨域ajax请求,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
收藏 0 赞 0 分享

浅析Vue中method与computed的区别

在new Vue的配置参数中的computed和methods都可以处理大量的逻辑代码,但是什么时候用哪个属性,要好好区分一下才能做到正确的运用vue。这篇文章主要介绍了Vue中method与computed的区别,需要的朋友可以参考下
收藏 0 赞 0 分享

Vue2.0 http请求以及loading展示实例

下面小编就为大家分享一篇Vue2.0 http请求以及loading展示实例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
收藏 0 赞 0 分享

轻松搞定jQuery+JSONP跨域请求的解决方案

了解了jsonp之后,大家应该也都明白了,jsonp主要就是用来实现跨域的获取数据,今天我们就来详细探讨下如何在实际中应用jsonp实现跨域
收藏 0 赞 0 分享

Vue2.0实现组件数据的双向绑定问题

这篇文章主要介绍了Vue2.0实现组件数据的双向绑定问题,非常不错,具有参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

node的process以及child_process模块学习笔记

这篇文章主要介绍了node的process以及child_process模块学习笔记,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
收藏 0 赞 0 分享

vue2.0 循环遍历加载不同图片的方法

下面小编就为大家分享一篇vue2.0 循环遍历加载不同图片的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
收藏 0 赞 0 分享

浅谈Vue2.0中v-for迭代语法的变化(key、index)

下面小编就为大家分享一篇浅谈Vue2.0中v-for迭代语法的变化(key、index),具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
收藏 0 赞 0 分享

使用vue-aplayer插件时出现的问题的解决

这篇文章主要介绍了使用vue-aplayer插件时出现的问题的解决,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
收藏 0 赞 0 分享

Element-ui table中过滤条件变更表格内容的方法

下面小编就为大家分享一篇Element-ui table中过滤条件变更表格内容的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
收藏 0 赞 0 分享
查看更多