【发布时间】:2019-10-03 02:50:03
【问题描述】:
我有一个带有一个输入的表单,您可以在其中键入网站的 URL,然后 URL 应该被发送到同一网页上的 iframe,它应该 iframe 的 URL。这是我当前在 URL 输入中键入 http://example.com 时得到的代码,它给了我错误,cannot GET /my_frame%22?Url=http%3A%2F%2Fexample.com
<html>
<head>
<title>Form Iframe Demo</title>
</head>
<body>
<form action=my_frame" >
<input type="text" name="Url" value="http://" />
<input type="submit" />
</form>
<--Iframe should receive url from the form and then Iframe it -->
<iframe name="my_frame" src="Url" width="860px">
</iframe>
</body>
</html>
尝试过使用它,但它让我陷入困境
我希望它有一个 http://example.com 的 iframe,但我收到一个错误
【问题讨论】:
-
我不确定这是否是您正在寻找的,但stackoverflow.com/questions/168455/how-do-you-post-to-an-iframe 可能会有所帮助
-
我早些时候看到了恐怕它不起作用,但我标记的答案对我来说非常有效。