我必须使用POST方法将一些参数发送到IFRAME。 我已经在这里读到Setting the HTTP request type of an <iframe>这是不可能的。我想在Javascript中的解决方案,但我不能实现它,所以我不能测试它是否是这个问题的有效解决方案。 我想问问是否有人有同样的问题,如果有可能解决,并在积极情况下如何?如何使用HTTP POST请求将参数发送到Iframe
18
A
回答
29
<form ... target="hidden_iframe">
...
</form>
<iframe name="hidden_iframe" ...></iframe>
+0
只是使形式隐形和iframe太..然后做一个表格提交通过js – walialu
16
如何使用窗体的target属性指向iFrame?
<form target="myIframe" action="http://localhost/post.php" method="post">
<input type="hidden" value="someval" />
<input type="submit">
</form>
<iFrame src="" name="myIframe"></iFrame>
8
只给一个具体的工作示例
<form id="loginForm" target="myFrame" action="https://localhost/j_spring_security_check" method="POST">
<input type="text" name="j_username" value="login" />
<input type="text" name="j_password" value="password" />
<input type="submit">
</form>
<iframe name="myFrame" src="#">
Your browser does not support inline frames.
</iframe>
// Hide the form and do the submit
<script>
$(document).ready(function(){
var loginform= document.getElementById("loginForm");
loginform.style.display = "none";
loginform.submit();
});
</script>
相关问题
- 1. 如何使用php在HTTP POST请求中发送参数?
- 2. 发送HTTP POST请求使用PHP
- 3. 发送HTTP POST请求
- 4. JAVA发送POST http请求
- 5. 发送HTTP POST请求
- 6. Wit.ai POST /发送HTTP请求
- 7. 如何让Ajax.ActionLink发送Http Post请求?
- 8. 如何将Rails对象作为参数发送到POST请求
- 9. 如何在节点中发送参数以及POST http请求?
- 10. 如何将HTTP POST请求发送到其他网站?
- 11. 发送数据从Javafx发送到HTTP POST请求
- 12. 如何使用具有复杂参数的运动衫发送HTTP Post请求
- 13. 用YII框架发送HTTP POST请求
- 14. 用Android发送HTTP POST请求
- 15. Angular2 - HTTP POST请求参数
- 16. 如何使用nsurlconnection发送post请求
- 17. 如何使用django发送POST请求?
- 18. 如何使用Volley发送POST请求
- 19. 如何使用HTTPie发送POST请求?
- 20. 使用请求将POST请求发送到Mixcloud
- 21. 如何使用Jersey客户端发送http请求参数
- 22. 发送POST请求
- 23. 发送表单数据发布请求使用Http Post在android
- 24. 如何发送POST请求?
- 25. 如何使用winapi将POST请求发送到某个网站?
- 26. 如何使用C#WebClient将POST请求发送到Google Translate Api?
- 27. 如何使用RestTemplate将POST请求发送到相对URL?
- 28. C++ - 如何使用Curlpp或libcurl发送HTTP post请求
- 29. 如何使用gziped内容发送HTTP POST请求?
- 30. 如何使用spring发送HTTP post请求
见http://stackoverflow.com/questions/168455/how-do-you-post-to-an-iframe –