html笔记

来源:互联网 发布:linux tail -f 编辑:程序博客网 时间:2024/06/06 10:05

从a.html打开b.html并传参数给b.html

假设在a.html中打开b.html?account=linxinfa

在b.html中要获取参数account的值,可以这样

<html>   <head>    <script>      var thisURL = document.URL;      var  account=thisURL.split('?')[1];    var accountValue= getval.split("=")[1];    function  getAccount(){       alert(accountValue);    }  </script>   </head>   <body onload="getAccount()">    </body>  </html> 



<meta> 一般放置于 <head> 区域

每30秒中刷新当前页面:

<meta http-equiv="refresh" content="30">

<link> 标签定义了文档与外部资源之间的关系。

<link> 标签通常用于链接到样式表:

<head><link rel="stylesheet" type="text/css" href="mystyle.css"></head>


html调用js脚本的函数

test.js

function SayHello(){var a=document.getElementById("a");a.innerHTML="hello";}
home.html

<html><script type="text/JavaScript" src="test.js"></script><button id="a" onclick="SayHello()">DDDD</button></html>



连接下载

<a href="/download/a.png">下载图片</a>




0 0
原创粉丝点击