5
回答
只输入网址不添加http://前缀不能进入站点谁可以解决?
华为云实践训练营,热门技术免费实践!>>>   

只输入网址不添加http://前缀不能进入站点谁可以解决?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>My Web Browser</title>
		<script type="text/javascript">	
	  		function onchang(id)
	  		{
	  			var address = document.getElementById("addr").value;
	  			if( address == '' ) {
	  				alert("Please input address!!!");
	  			} else {
	  				document.getElementById(id).src = address;
	  			}
	  		}
	  	</script>
	</head>
	<body>
	<form action="javascript:onchang('browser');" method="post">
			浏览网页&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=red><a href="javascript:close()" targer="browser">╳</a></font>
			<div>
				<button type="button" onClick="javascript:history.back(1)">←</button>
				<button type="button" onClick="javascript:history.go(1)">→</button>
				<button type="button" onClick="document.all.WebBrowser.ExecWB(22,1)">刷新</button>
				<input id="addr" type="text" size="60" value="http://" color="yellow">
				<button type="submit">-></button>
				<button type="button" onClick="javascript:stop()">×</button>
				<a href="connection.html" target="browser">链接</a>
			<div>

			<iframe id="browser" name="browser" src="" allowtransparency="auto" scrolling="auto" width="710" height="400" frameborder="1"></iframe>
		</form>
	</body>
</html>

<无标签>
举报
杨东贤
发帖于5年前 5回/3K+阅
顶部