Git Product home page Git Product logo

xml-to-json-proxy's Introduction

= XML to JSON Proxy =

Tools that allow client-side XML calls in the browser. Using Flash crossdomain calls, the XML is converted to JSONML and delivered in JavaScript.

== When to use? ==

you want to do a simple light integration, but the API your using only supports XML calls or JSON calls without callbacks. An example service at the moment of writing is Imeem.com. To work around doing browser-client-side calls, we can use a Flash/SWF proxy (written in ActionScript 3) that does the XML call and delivers it in JSONML format (http://jsonml.org/) to a Javascript callback.

Note: this was originally written for Last.fm - which at the time didn't have JSON callback support in their API, now they do.

== Example code ==

Check xml_json_proxy.html for an example of how to use this with Imeem.

Setting up the proxy:

<script type="text/javascript" src="xml_json_proxy.js"></script>
<script type="text/javascript">
  function callback_on_error(code, message) {
    alert(code + ': '+ message);
  }
  function callback_on_success(url, jsonml) {
    alert(jsonml);
  }
  proxy = new XMLJSONProxy('error_callback');
</script>

Performing a GET call (POST support is yet to come):

proxy.get('callback_on_success', 'http://url.of.call.xml/');

== License ==

All is Creative Commons attributed to Dominiek ter Heide (http://dominiek.com/)

xml-to-json-proxy's People

Contributors

dominiek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.