I was trying to get the value from my child.jsp to my parent.jsp using
window.opener.document.getElementById("parentId1").value = myvalue;
Even though there were no errors found in the console the value is not getting in the parent page.
The child popup window has the url starting like,
.....
and the parent page url
starts with http://....
is there any issue in municating with a secure child window and a parent page which is not secure?
If so how can I solve this issue?
I was trying to get the value from my child.jsp to my parent.jsp using
window.opener.document.getElementById("parentId1").value = myvalue;
Even though there were no errors found in the console the value is not getting in the parent page.
The child popup window has the url starting like,
https://safe.cresecure/securepayments.....
and the parent page url
starts with http://....
is there any issue in municating with a secure child window and a parent page which is not secure?
If so how can I solve this issue?
Share Improve this question asked Aug 21, 2013 at 7:35 NidheeshNidheesh 4,56230 gold badges93 silver badges156 bronze badges1 Answer
Reset to default 3is there any issue in municating with a secure child window and a parent page which is not secure?
Yes. HTTP and HTTPS make for separate script origins. (If they were not separate origins then an unprotected page could script into an HTTPS page and change all its content, defeating the purpose of HTTPS.)
If so how can I solve this issue?
Same origin. Serve the parent page through HTTPS, and either put them on the same hostname or set
document.domain
to a shared parent domain on both documents.Cross-origin messaging.
window.postMessage
; if you need to support older browsers (primarily IE<8) then there are horrible backwards patibility hacks (like municating throughdocument.cookie
or hash navigation).Server interaction. One document sends the information to the server and the server shares it back with the other document (eg using XMLHttpRequest).
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744348047a4569807.html
评论列表(0条)