Back

The Javascript code generated by each condition option.

In all of these examples {{VALUE}} represents the value from the text field in the extension or load rule. The variable being compared against is the built-in variable dom.title (or cart_total_items and va.badges.42 for operators relevant to number and badges respectively).

contains
(b['dom.title'].toString().indexOf('{{VALUE}}') > - 1)

contains

(ignore case)

(b['dom.title'].toString().toLowerCase().indexOf('{{VALUE}}'.toLowerCase()) > - 1)    
is defined
(typeof b['dom.title'] != 'undefined') 
does not contain
(b['dom.title'].toString().indexOf('{{VALUE}}') < 0) 
does not contain (ignore case)
(b['dom.title'].toString().toLowerCase().indexOf('{{VALUE}}'.toLowerCase()) < 0)   
does not end with
(!/{{VALUE}}$/.test(b['dom.title']))
does not end with (ignore case)
(!/{{VALUE}}$/i.test(b['dom.title']))
does not equal
(b['dom.title'] != '{{VALUE}}')
does not equal (ignore case)
(b['dom.title'].toString().toLowerCase() != '{{VALUE}}'.toLowerCase())
does not start with
(!/^{{VALUE}}/.test(b['dom.title']))
does not start with (ignore case)
(!/^{{VALUE}}/i.test(b['dom.title']))
ends with
(/{{VALUE}}$/.test(b['dom.title']))

ends with

(ignore case)

(/{{VALUE}}$/i.test(b['dom.title']))
equals
(b['dom.title'] == '{{VALUE}}')  

equals

(ignore case)

(b['dom.title'].toString().toLowerCase() == '{{VALUE}}'.toLowerCase())
greater than
(parseFloat(b['cart_total_items']) > parseFloat({{VALUE}}))
greater than or equal to
(parseFloat(b['cart_total_items']) >= parseFloat({{VALUE}}))
is badge assigned
(typeof b['va.badges.42'] != 'undefined')
is badge not assigned
(typeof b['va.badges.42'] == 'undefined')   
less than
(parseFloat(b['cart_total_items']) < parseFloat({{VALUE}}))
less than or equal
(parseFloat(b['cart_total_items']) <= parseFloat({{VALUE}}))  
is not defined
(typeof b['dom.title'] == 'undefined') 
is not populated
(typeof b['dom.title'] != 'undefined' && b['dom.title'] == '')  
is populated
(typeof b['dom.title'] != 'undefined' && b['dom.title'] != '')  
regular expression
(/{{VALUE}}/.test(b['dom.title']))  
starts with
(/^{{VALUE}}/.test(b['dom.title'])) 
starts with (ignore case)
(/^{{VALUE}}/i.test(b['dom.title']))