Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement XD transport based on JSONPI: yes Virginia, it is possible! #3

Open
MaxMotovilov opened this issue Jun 20, 2011 · 0 comments
Assignees

Comments

@MaxMotovilov
Copy link
Owner

Use JSONPI approach as outlined by Ben Vinegar on TxJS 2011 to implement limited XD capability:

Sendng request:

document.domain = "toplevel.com"; // Have to be on subdomain1.toplevel.com or won't work!

(iframe name="jsonpi_target")

(form target="jsonpi_target" method="{desired HTTP verb}" action="{XD-url on subdomain2.toplevel.com}")
  (input type="hidden" name="body" value="{PUT or POST body}")
(/form)

Sending response:

(script)
  document.domain = "toplevel.com"; // Have to be on subdomain2.toplevel.com or won't work!
  getJSONPICallback( key_url_params, window.parent )( {Response body} );
(/script)

Optimally, the implementation should use a Dojo transport for JSONPI which is yet to be implemented...

@ghost ghost assigned MaxMotovilov Jun 20, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant