⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.htm

📁 实现了一个简单的web服务器
💻 HTM
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
	<meta http-equiv="Content-Language" content="en-us" />
	<meta name="robots" content="all" />
	<meta name="author" content="Luka Cvrk (www.solucija.com)" />
	<meta name="Copyright" content="" />
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<link href="images/style.css" rel="stylesheet" type="text/css" />
	<title>Open your windows!</title>
</head>
<body>     <script src="prototype.js"></script>	<script>	 function turn_on(btn,index){		 btn.disabled=true;		var ajax=new Ajax.Request(		'http://192.168.0.50:9000/turn_on.do?index='+index,		{			method:'GET',			onComplete:function(response){				 btn.disabled=false;				$('led'+index).style.background="yellow";$('led'+index).innerHTML="on";setInterval("turn_off("+index+")",1000);			}		}		)			}; function turn_off(index){		 				$('led'+index).style.background="blue";				$('led'+index).innerHTML="off";	}; function get_status( ){		 		var ajax=new Ajax.Request(		'http://192.168.0.50:9000/get_status.do',		{			method:'GET',			onComplete:function(response){ 				$('status').innerHTML=response.responseText;					}		}		)	}; function get_history( ){		 		var ajax=new Ajax.Request(		'http://192.168.0.50:9000/get_history.do',		{			method:'GET',			onSuccess:function(response){   				$('history').value=response.responseText;			}		}		)	}; function get_log( ){		 		var ajax=new Ajax.Request(		'http://192.168.0.50:9000/get_log.do',		{			method:'GET',			onComplete:function(response){				 				$('log').value=response.responseText;			}		}		)	};	</script>
	<div id="wrap">
	  <div id="container"> 
			<div id="header">
				<p class="white">Open your  windows !</p>
			</div>
    	
		 
    	
      		<div id="left_column"> 
      			
    			 
				
				<p>Every menu item has it's <b>accesskey</b> which is underlined and you can access it by pressing <b>ALT+character</b> (CTRL+character on Mac). </p>
				<p>Hovering over the menu items reveals it's short description.</p>
				<p><br /><b>Important links:</b></p>
				<p><a href="http://www.oswd.org/userinfo.phtml?user=LanVacation">My OSWD showcase</a><br />
				<a href="http://www.andreasviklund.com/">Andreas Viklund</a><br />
				<a href="http://www.solucija.com/">Solucija</a><br />
				<a href="http://snews.awddesign.co.uk/">Try sNews live!</a></p>
							
			</div> 
			
			<div id="right_column">
				<div class="main_article" style="text-align:center">
    				<h3 align="left" class="white">Look, the lights are shining <span class="red">!</span></h3> 
      				<LI class="white">LED1<span>&nbsp;&nbsp;</span><span id="led1" style="background:blue">off</span>
					<input type="button" value="turn on" onclick="turn_on(this,1)">
					 </LI> 
					<LI class="white">LED2<span>&nbsp;&nbsp;</span><span id="led2" style="background:blue">off</span>
					  <input type="button" value="turn on" onclick="turn_on(this,2)">
					 </LI> 
					<LI class="white">LED3<span>&nbsp;&nbsp;</span><span id="led3" style="background:blue">off</span>
					  <input type="button" value="turn on" onclick="turn_on(this,3)">
					 </LI> 
					<LI class="white">LED4<span>&nbsp;&nbsp;</span><span id="led4" style="background:blue">off</span>
					  <input type="button" value="turn on" onclick="turn_on(this,4)">
					 </LI> 
					<LI class="white">LED5<span>&nbsp;&nbsp;</span><span id="led5" style="background:blue">off</span>
					  <input type="button" value="turn on" onclick="turn_on(this,5)">
					 </LI> 
					<LI class="white">LED6<span>&nbsp;&nbsp;</span><span id="led6" style="background:blue">off</span>
					  <input type="button" value="turn on" onclick="turn_on(this,6)">
					 </LI> 
					<LI class="white">LED7<span>&nbsp;&nbsp;</span><span id="led7" style="background:blue">off</span>
					  <input type="button" value="turn on" onclick="turn_on(this,7)">
					 </LI> 
					<LI class="white">LED8<span>&nbsp;&nbsp;</span><span id="led8" style="background:blue">off</span>
					  <input type="button" value="turn on" onclick="turn_on(this,8)">
				 </LI> 
					 	
      				
      			</div> 
				
			<div class="other">
				<div class="left" style="height:300px">
					<h2>history</h2> <input type=button value="getHistory" onclick="get_history()" /> 
			    <p >
					   <textarea id="history" rows="10" >				    </textarea>	
				</p>
	 		  </div>
			 
				<div class="right" style="height:300px">
				  <h2>log</h2><input type=button value="getLog" onclick="get_log()" /> 
				  <p  >
				   <textarea id="log" rows="10" >				    </textarea>		
				  </p>
			  </div>
			</div>
    	</div>
    </div>
	<div id="footer">
		&copy; 2005, <a href="#">YourSeason.com</a>, Design: <a href="mailto:luka@solucija.com">Luka Cvrk</a>, <a href="http://www.solucija.com/">Solucija</a>, <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> and <a href="http://validator.w3.org/check?uri=referer">XHTML</a> barbecue.
	</div>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -