In my html page(file:///C:/Users/NEC/Desktop/test.html) has the javascript variable(or input text field) and iframe
that call to other host(localhost:8081/TProject/sample.html).
In test.html
<iframe src="localhost:8081/TProject/sample.html" ></iframe><br/>
<input type="text" id="output" ><br />
And, in my sample.html shown in iframe
has follow javascript
code to change the value of input text of parent window.
function setData() {
window.parent.getElementById("output").value = "hello";
}
Error message is:
Uncaught SecurityError: Blocked a frame with origin "localhost:8081" from
accessing a frame with origin "null". The frame requesting access has a protocol of
"http", the frame being accessed has a protocol of "file". Protocols must match.
How can I pass the value (javascript variable) to offline html page from online server?