function displayMessage (evt) { var message; message = evt.data; //document.getElementById("bxr-iframe").src = message; } if (window.addEventListener) { window.addEventListener("message", displayMessage, false); } else { window.attachEvent("onmessage", displayMessage); }