You cannot directly control javascript pages in iframes with any code on the parent page.
If you have the ability to change both pages, you can change "page B" to run javascript based on the parameters in this query string.
' A' iframe src - :
http://mydomain.com/pageb.html?func=myfunc¶m=foo¶m2=bar
'page B' javascript :
function queryToLookup(query) {
var lookup= {};
var params= query.slice(1).split(/[&;]/);
for (var i= 0; i<params.length; i++) {
var ix= params[i].indexOf('=');
if (ix!==-1) {
var name= decodeURIComponent(params[i].slice(0, ix));
var value= decodeURIComponent(params[i].slice(ix+1));
if (!(name in lookup))
lookup[name]= [];
lookup[name].push(value);
}
}
return lookup;
}
function myTestFunc(p1, p2) {
alert('param 1 is ' + p1 + ' and p2 is ' + p2);
}
jQuery(document).ready(function() {
var params = queryToLookup(location.search);
switch(lookup['func'])
{
case 'myfunc': myTestFunc(params['param1'], params['param2']);
case 'otherfunc': myTestFunc('someval', params['param1']);
default: alert('No function requested');
}
});
, , , . , "A", ( ) A, top.location = 'pagea.html?message=foo' (, ).