вобщем с тебя быть добрым и отзывчевым
код на сайте
http://run.local/index.htm
<html>
<script type="text/javascript">
PostAjax = {};
PostAjax.receiveMessage = function (event) {
window.location.hash = event.data;
};
PostAjax.AddEvent = function (obj, eventType, fn) {
var that = this;
var tempFunction = function (e) { fn.call(that, e); };
if (obj.addEventListener) {
obj.addEventListener(eventType, tempFunction, false);
return true;
} else if (obj.attachEvent) {
var r = obj.attachEvent("on" + eventType, tempFunction);
return r;
} else {
return false;
}
};
PostAjax.AddEvent(window, 'message', PostAjax.receiveMessage);
function MyOnLoad() {
var frameRequest = document.getElementById("myIFrame");
frameRequest.setAttribute("src","http://your.local" + window.location.hash.slice(1));
}
</script>
<body id="myBody" onload="MyOnLoad();">
<iframe id="myIFrame">
</iframe>
</body>
</html>
код на сайте
http://your.local/page1.htm
<script type='text/javascript'>
var url = window.location.pathname;
var parentUrl = "http://run.local";
window.parent.postMessage(url, parentUrl);
</script>
запускаем:
http://run.local/index.htm#/page1.htm