• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

READMEH A D05-Mar-20174 KiB8366

xip.js.mapH A D05-Mar-201711.2 KiB98

README

1-------------------------------------------------------------------------------
2Project Name
3-------------------------------------------------------------------------------
4Version 0.6
5Release date: 01/31/2008
6-------------------------------------------------------------------------------
7Project state:
8experimental
9-------------------------------------------------------------------------------
10Credits
11	James Burke (jburke@dojotoolkit.org)
12-------------------------------------------------------------------------------
13Project description
14
15The XHR IFrame Proxy (xip) allows you to do cross-domain XMLHttpRequests (XHRs).
16It works by using two iframes, one your domain (xip_client.html), one on the
17other domain (xip_server.html). They use fragment IDs in the iframe URLs to pass
18messages to each other. The xip.js file defines dojox.io.proxy.xip. This module
19intercepts XHR calls made by the Dojo XHR methods (dojo.xhr* methods). The module
20returns a facade object that acts like an XHR object. Once send is called on the
21facade, the facade's data is serialized, given to xip_client.html. xip_client.html
22then passes the serialized data to xip_server.html by changing xip_server.html's
23URL fragment ID (the #xxxx part of an URL). xip_server.html deserializes the
24message fragments, and does an XHR call, gets the response, and serializes the
25data. The serialized data is then passed back to xip_client.html by changing
26xip_client.html's fragment ID. Then the response is deserialized and used as
27the response inside the facade XHR object that was created by dojox.io.proxy.xip.
28-------------------------------------------------------------------------------
29Dependencies:
30
31xip.js: Dojo Core, dojox.data.dom
32xip_client.html: none
33xip_server.html: none (but see Additional Notes section)
34-------------------------------------------------------------------------------
35Documentation
36
37There is some documentation that applies to the Dojo 0.4.x version of these files:
38http://dojotoolkit.org/book/dojo-book-0-4/part-5-connecting-pieces/i-o/cross-domain-xmlhttprequest-using-iframe-proxy
39
40The general theory still applies to this code, but the specifics are different
41for the Dojo 0.9+ codebase. Doc updates hopefully after the basic code is ported.
42
43The current implementation destroys the iframes used for a request after the request
44completes. This seems to cause a memory leak, particularly in IE. So, it is not
45suited for doing polling cross-domain requests.
46-------------------------------------------------------------------------------
47Installation instructions
48
49Grab the following from the Dojox SVN Repository:
50http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/io/proxy/xip.js
51http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/io/proxy/xip_client.html
52
53Install into the following directory structure:
54/dojox/io/proxy/
55
56...which should be at the same level as your Dojo checkout.
57
58Grab the following from the Dojox SVN Repository:
59http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/io/proxy/xip_server.html
60
61and install it on the domain that you want to allow receiving cross-domain
62requests. Be sure to read the documentation, the Additional Notes below, and
63the in-file comments.
64-------------------------------------------------------------------------------
65Additional Notes
66
67xip_client.html and xip_server.html do not work right away. You need to uncomment
68out the script tags in the files. Additionally, xip_server.html requires a JS file,
69isAllowed.js, to be defined. See the notes in xip_server.html for more informaiton.
70
71XDOMAIN BUILD INSTRUCTIONS:
72The dojox.io.proxy module requires some setup to use with an xdomain build.
73The xip_client.html file has to be served from the same domain as your web page.
74It cannot be served from the domain that has the xdomain build. Download xip_client.html
75and install it on your server. Then set djConfig.xipClientUrl to the local path
76of xip_client.html (just use a path, not a whole URL, since it will be on the same
77domain as the page). The path to the file should be the path relative to the web
78page that is using dojox.io.proxy.
79
80
81
82
83