开发者社区> 问答> 正文

谁能帮我把下面代码制作成web浏览器?? 400 报错

谁能帮我把下面代码制作成web浏览器?? 400 报错

谁能帮我把下面代码制作成web浏览器?

<form>
<div>
<button type="button">←</button><button type="button">→</button><button type="button"> 〇 </button><input type="textarea" size="90"><button type="submit" onClick="onchang("browser")">-></button><button type="submit" onClick="onchang("browser")" value="stop">×</button>
<div>
<iframe name="browser" src="#" autosize="true"width="640" height="400" border="1"></iframe>
</form>

←→刷新->×

展开
收起
爱吃鱼的程序员 2020-05-31 00:41:27 531 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    只做了简单实现,没有做前进,后退,停止这些功能,也没有做输入地址的验证,代码如下:

    <!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">
    			<div>
    				<button type="button"><-</button>
    				<button type="button">-></button>
    				<button type="button">Flush</button>
    				<input id="addr" type="text" size="60" value="http://www.iteye.com">
    				<button type="submit">GO</button>
    				<button type="submit">Stop</button>
    			<div>
    			<iframe id="browser" name="browser" src="" autosize="true"width="640" height="400" border="1"></iframe>
    		</form>
    	</body>
    </html>

    效果图:

    ######前面不会自动添加http://前缀,该怎样解决?######回复 @情天大圣 : 谢谢啊.######回复 @杨东贤 : 当然,要不然怎么敢发出来######差不多,可用,######web浏览器?木有听过 ######像webQQ中的网页浏览应用######没看懂想表达个啥意思~######网页浏览器,你可以复制,查看为html######没看懂是要啥。。。。######没看懂是要干啥。。。。######没看懂是要干什么。。。。######修改为web浏览器######不知道什么意思######没看懂是做弄啥。。。
    ######真的可以用
    2020-05-31 00:41:29
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Web应用系统性能优化 立即下载
高性能Web架构之缓存体系 立即下载
PWA:移动Web的现在与未来 立即下载