i am using following code for trying to send a value from iframe to webpage and want to submit automatically using java script, but getting an following error,
"Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://localhost:53182" from accessing a cross-origin frame."
My code is
function load() { alert("hh"); // get the iframe in my documnet var iframe = document.getElementById("myframe"); // get the window associated with that iframe var iWindow = iframe.contentWindow; // wait for the window to load before accessing the content var doc = iframe.contentDocument || iframe.contentWindow.document; // find the target in the iframe content var target = doc.getElementById("txtLrNo"); target.innerHTML = "Found It!"; }
"Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://localhost:53182" from accessing a cross-origin frame."
My code is
Open in new window