<html>
<head>
<script src=
"library.js"></script>
</head>
<body>
<p>
This
is a paragraph of HTML
</p>
<script>
</script>
<p>
Here
is more HTML.
</p>
</body>
</html>
<script>
function moveon(){
var answer=confirm(
"准备好了吗")
if(answer){
window.location=
"http://taobao.com";
}
}
setTimeout(moveon,
60000)
</script>
function debug(msg){
var log=document.getElementById(
"debuglog");
if(!log){
log=document.createElement(
"div");
log.id=
"debuglog";
log.innerHTML=
"<h1>Debug Log</h1>";
document.body.appendChild(log);
}
var pre=document.createElement(
"pre");
var text=document.createTextNode(msg);
pre.appendChild(text);
log.appendChild(pre);
}
function hide(e,reflow){
if(reflow){
e.style.display=
"none";
}
else{
e.style.visibility=
"hidden";
}
}
function highlight(e){
if(!e.className){
e.className=
"hilite";
}
else{
e.className+=
"hilite";
}
}
<script src=
"debug.js"></script>
<script src=
"hide.js"></script>
Hello
<button onclick=
"hide(this,true);debug('hide button 1);" >Hide1</button>
<button onclick=
"hide(this);debug('hide button 2);">Hide2</button>
World
window.onload=
function(){
var images=document.getElementsByTagName(
"img");
for(
var i=
0;i<images.length;i++){
var image=images[i];
if(image.addEventListener){
image.addEventListener(
"click",hide,
false);
}
else{
image.attachEvent(
"onclick",hide);
}
}
function hide(event){
event.target.style.visibility=
"hidden";
}
}
function debug(msg){
var log=$(
"#debuglog");
if(log.length==
0){
log=$(
"<div id='debuglog'><h1>Debug Log<h1></div>");
log.appendTo(document.body);
}
log.append($(
"<pre/>").text(msg));
}
转载请注明原文地址: https://ju.6miu.com/read-969888.html