Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JQuery plugin for cross domain content loading with Iframe and using window.postMessage or fall back on window.name transport for older browsers.
JavaScript PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README
form.php
form_test.html
index.html
jquery.crossdomain.data.js
source.html

README

-------------------------------
Cross Domain Data JQuery Plugin
-------------------------------
-- by Boris Kuzmic
-- version 0.2
-- license: MIT - http://www.opensource.org/licenses/mit-license.php

Plugin can be used to dynamically load content from same or other domains. It can also
post form data to remote server script.
It’s creating a hidden iframe object to fetch remote page and when remote page sends data 
(either via window.postMessage in all modern browsers or via window.name in IE 6 & 7), 
data is read and callback method is invoked.

Simple usage:

Only to retrieve data:

$.getRemoteData(
    function(data){
       $("body").append( data );
    },
    'http://-some-remote-url-/source.html'
);

To post form use it like this:

$.postFormRemote(
    function(data){
        $("#form_result").append( data );
    },
    'form_id', 'form_url', 'form_method'
);

In source page one must add code like this (as last body element), 
to enable true cross domain interaction:

<script type="text/javascript">
    window.name = $("body").html();
    try {
        var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined);
 
        if (typeof target != "undefined") {
            target.postMessage($("body").html(), "*");
        }
    } catch (e) {/**/}
</script>
 

For more info visit wiki:

http://wiki.github.com/bkuzmic/jquery-crossdomain-data-plugin
Something went wrong with that request. Please try again.