javascript - call iframe function from parent window -


how call javascript function in ifram parent window. have jsp page contains iframe. jsp page served "a.yenama.net" server , iframe served "b.yenama.net" server.

<iframe width="1200" height="640" name="data" id="dataid" > </iframe> <br/> <input type="button" name="data" value="save data" onclick="callsavedata();" /> 

tried below code parent jsp page , recieved permission denied error in ie

window.frames['data'].calldata(); 

also tried

document.getelementbyid('dataid').contentwindow.calldata(); //didn't work 

function in iframe

window.calldata = function(){ alert('iframe function'); } 

your appreciated.

you can declaring function in common .js file therefore, can access function wherever want.

have nice day


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -