fix code sample in `__utils__.findAll` documentation
this code doesn't work; `Array.prototype.forEach` should be `Array.prototype.map`.
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -109,7 +109,7 @@ Retrieves all DOM elements matching a given :ref:`selector expression <selectors | ... | @@ -109,7 +109,7 @@ Retrieves all DOM elements matching a given :ref:`selector expression <selectors |
109 | casper.start('http://foo.bar/', function() { | 109 | casper.start('http://foo.bar/', function() { |
110 | links = this.evaluate(function() { | 110 | links = this.evaluate(function() { |
111 | var elements = __utils__.findAll('a.menu'); | 111 | var elements = __utils__.findAll('a.menu'); |
112 | return Array.prototype.forEach.call(elements, function(e) { | 112 | return elements.map(function(e) { |
113 | return e.getAttribute('href'); | 113 | return e.getAttribute('href'); |
114 | }); | 114 | }); |
115 | }); | 115 | }); | ... | ... |
-
Please register or sign in to post a comment