1. How to transfer the information in iframe to div? 2. If div is used without iframe, how can we make the form in the div submit without redirecting? 3. After a file is submitted to the server, how does one obtain its address and return it to the input file? {Code...} upload. php: {code...} 1. How to transmit the information in iframe to p?
2. if I use p instead of iframe, how can I submit the form in p without redirecting?
3. After a file is submitted to the server, how does one obtain its address and return it to the input file?
Upload. php:
Script // upload image function uploadImg () {$ ("form: first"). trigger ("submit")} script
Reply content:
1. How to transmit the information in iframe to p?
2. if I use p instead of iframe, how can I submit the form in p without redirecting?
3. After a file is submitted to the server, how does one obtain its address and return it to the input file?
Upload. php:
Script // upload image function uploadImg () {$ ("form: first"). trigger ("submit")} script
upload.php
After saving the file, return the following path to the upper layer.
Script parent. $ ('input'). val ("
"); Script
Simply putparent
Then you can accessiframe
The content in the page.
Online Demo address: https://xqin.net/temp/up.html
up.php
The Code is as follows (this is only a demonstration, so only the current time is output ):
Response scriptaskparent.doc ument. getElementById ('result'). value ="
"; Script uploaded!
I encountered iframe and external communication when I was working on the chrome plug-in. I don't know if it is helpful.
Https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
Https://github.com/xwartz/xwartz.github.com/issues/1
H5web communication, http://www.cnblogs.com/ATree/archive/2012/03/07/html5-web-messaging.html
After the iframe is successfully renewed, the value is redirected to the iframe.
Event upload to window. onload, and then get data in iframe.
The window object in iframe can not be obtained externally. Get a function externally, block the default event when submitting the object in iframe, and then call the external callback.
Asynchronous form submission is not enough.