cannot send javascripts to parent - Forum

Forum Navigation
You need to log in to create posts and topics.

cannot send javascripts to parent

I created a html document with VisualNEO Web that I have loaded into an iframe. But I cannot send any javascripts to the parent. This JS does not work at all. What am I doing wrong?

 

BeginJS

parent.document.formA.T1.value='OK';

parent.document.body.style.backgroundColor = 'red';

EndJS

 

Try this:

BeginJS
window.parent.document.formA.T1.value='OK';
window.parent.document.body.style.backgroundColor = 'red';
EndJS

Let me know if this works for you.

Quote from luishp on February 1, 2019, 9:53 am

Try this:

BeginJS
window.parent.document.formA.T1.value='OK';
window.parent.document.body.style.backgroundColor = 'red';
EndJS

Let me know if this works for you.

window . parent is the correct syntax.    I can focus the parent document from the iframe with window . parent . focus ( ) ;

but the  functions won't work. Maybe this is something with the Chrome browser or cross-domain blocking, although I am testing from my local drive.

 

I think it is probably becouse a cross-domain blocking.
Try using a local web-server like this one.

Quote from luishp on February 2, 2019, 9:17 pm

I think it is probably becouse a cross-domain blocking.
Try using a local web-server like this one.

Looks like big corporations are doing everything they can to cripple the Internet. Remember when the Netscape browser could be used as a file manager, and go into your Windows System folders? The next version of Chrome might not allow third party code at all ....  https://news.softpedia.com/news/google-chrome-72-s-code-injection-blocking-detailed-524759.shtml?fbclid=IwAR2oSR5mXtwzZ-z1T9bFD3dKsbxOO7IlIt3-RNXRmHK2KpY-c5eQfEX1oAI