Servis-Rhino 4211B Betriebsanweisung Seite 142

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 298
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 141
See also:
Deferred and asynchronous processing – dojo/Deferred
Ajax with Dojo
DojoToolkit: xhtGet
DojoToolkit: dojo/request/xhr (1.8)
Basic Access Authentication
sitepen - Introducing dojo/request - 2012-08-21
Testing REST Calls
There are a number of ways to test REST calls to a REST provider and it is recommended to do this
before embarking on writing application code to ensure that the results will be as expected. My
current favorite tool is called "Postman" and can be found:
http://www.getpostman.com/
This is a Google Chrome app/plugin.
Another useful tool for REST client testing is "soapUI".
Dojo utility
dojo/_base/lang
This is truly a work horse of Dojo especially for JavaScript function calling. The first item we will
discuss is "hitch".
var func2 = lang.hitch(context, func1);
What hitch does is take an object that will serve as a context. For example "this". The second
parameter is a reference to a function. What hitch returns is a new function which, when called,
will invoke the passed in function under the context of the passed in context. If you understand
that, great!! Now you see the power of lang.hitch(). If you don't understand that, then it is back to
the JavaScript manuals for you.
A friend to "hitch" is its buddy called "partial".
var func2 = lang.partial(func1, "val1", "val2");
Now … if when func1() is called, it NORMALLY expects a parameter called "myOriginalParm1"
we can provide an implementation of func1() which now accepts:
func1 = function(myNewParm1, myNewParm2, myOriginalParm1)
So what we have done is forced the func1 to accept some additional parameters beyond the ones
that will be supplied by its real caller.
DOM Access
Since Dojo is primarily designed to run within the context of a browser and the primary means of
programming a browser environment is the manipulation of the DOM, it makes sense that a lot of
function has been added to Dojo for DOM manipulation and access.
See also:
Page 142
Seitenansicht 141
1 2 ... 137 138 139 140 141 142 143 144 145 146 147 ... 297 298

Kommentare zu diesen Handbüchern

Keine Kommentare