How to define javascript variable from within a iframe -


i have iframe needs change global variable in parent page.

i tried

parent.myvar = "myvalue"; parent.myfunction(); 

however, it's not working me. function executes variable remains unchanged.

edit: both iframe , parent in same domain.

there nothing wrong code : https://stackoverflow.com/a/1301645/390330

// set global variable 'foo' in parent global scope parent.foo = 'bar'; 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -