Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
indent20px
styledisc

Background

Dojo (pre 1.7) has issues working correctly in an open social gadget because of the way code is loaded.

...

In either case, it should be noted that dojo's xhr module will not work well in a gadget environment and some tweaking is required to get it to work transparently. An example of piping dojo's xhr requests through osapi is shown below.

Examples

License for examples

...

  1. Simple dojo 1.4.3 gadget

...

...


<Module>
  <ModulePrefs title="Simple dojo 1.4.3 gadget" height="300">
  </ModulePrefs>

  <Content type="html"><![CDATA[
    <body class="tundra">
      <link rel="stylesheet" href="http://archive.dojotoolkit.org/cdn/1.4.3-cdn/google/1.4.3/dijit/themes/tundra/tundra.css" />
      <script src="http://archive.dojotoolkit.org/cdn/1.4.3-cdn/google/1.4.3/dojo/dojo.xd.js"
        djConfig="baseUrl: 'http://archive.dojotoolkit.org/cdn/1.4.3-cdn/google/1.4.3/dojo', parseOnLoad: true">
      </script>
      <script>
        dojo.require("dijit.dijit");
        dojo.require("dijit.Calendar");
      </script>
      <div dojoType="dijit.Calendar" 
        data-dojo-props="onChange:function(){dojo.byId('formatted').innerHTML=dojo.date.locale.format(arguments[0], {formatLength: 'full', selector:'date'})}">
      </div>
      <p id="formatted"></p>
    </body>
  ]]></Content>
</Module>

Simple dojo 1.7 gadget

...

  1. Simple

...

  1. dojo

...

  1. 1.7

...

  1. gadget

...

Simple dojo 1.8 gadget

...

  1. Simple

...

  1. dojo

...

  1. 1.8

...

  1. gadget

...

Dojo 1.8 xhr demo

...

  1. Dojo

...

  1. 1.8

...

  1. xhr

...

  1. demo

...