I have php application in https mode. And the parent(https) contains an iframe. The iframe src will be a http file. The parent and the iframe are in the same domain. But i am not able to access the iframe source开发者_开发问答 using http.
Is there any way in to fix this issue using php or javascript?
Thanks in advance.
Since you tagged this javascript, I assume you mean to access the iframe source using javascript.
Because of the same origin policy in your browser, pages can communicate across different windows or iframes only when their protocols (http vs. https), port, and domain are the same.
Since your protocols are different (http vs. https) you cannot use javascript in your page to access the document in the iframe.
Here is more info about same origin policy: https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript
精彩评论