js 调用同级的 iframe 方法


有两个 iframe 

想要在 b 中的js方法调用 a 的food 方法

应该写成

$(window.parent.$("#a"))[0].contentWindow.food(1);

如果id有特殊符号,可以用//来转义,如:

$(window.parent.$("#ifr_\\/ConstructionMg\\/ProcessInspection\\/hypjProcessinspection\\.htm"))[0].contentWindow.food(1);