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

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -