You can highlight different selectors according to events. If no event is specified but data-highlight is given, it will be used on success. If there are data-highlight-color-(event) specified without data-highlight-(event), the data-highlight selector will be used as fallback. Empty selectors (e.g. data-highlight="") will highlight themselves, like in the following examples. But you can of course put any valid jQuery selector.

Event Description Test 1 Test 2
data-highlight

Without event, data-highlight is an alias for data-highlight-success.

data-highlight-before

Will highlight selected elements before the ajax call.

 
data-highlight-complete

Will highlight selected elements after the ajax call, whatever if it failed or succeeded.

data-highlight-success

Will highlight selected fields after the ajax call, only if it succeeded.

data-highlight-failure

Will highlight selected fields after the ajax call, only if it failed.

data-highlight-empty

Will highlight selected fields after the ajax call, only if the response is empty.

data-highlight-not-empty

Will highlight selected fields after the ajax call, only if the response is not empty.

Back to domajax's home