jQuery.post() общение между сайтами

Example Code

<script type="text/javascript">
    function postSize(e){
        var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined);
        if (typeof target != "undefined" && document.body.scrollHeight)
           target.postMessage(jQuery('body').outerHeight(), "*");
        }
       window.addEventListener("load", postSize, false);
</script>



<script type="text/javascript"> function receiveSize(e){ if (e.origin === "https://site.url") document.getElementById("form").height = e.data; } window.addEventListener("message", receiveSize, false); </script>

http://api.jquery.com/jquery.post/

Комментарии