วัตถุหลักให้การอ้างอิงไปยังหน้าต่างหลักจากลูก
ต่อไปนี้เป็นรหัสหลัก คำสั่งด้านล่างทริกเกอร์ iFrame เพื่อส่งข้อความไปยังหน้าต่างหลักทุกๆ 3 วินาที ไม่ต้องการข้อความเริ่มต้นจากหน้าต่างหลัก!
var a= window.addEventListener ? "addEventListener" : "attachEvent";// here a is the event method
var b= window[a];// here b is the eventer
var c= a== "attachEvent" ? "onmessage" : "message";// here c is the message event
// Listen to message from child window
b (c,function(e) {
var d= e.message ? "message" : "data";// here d is the key
var f= e[d];//here f is data
},false);