Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
4f765725
...
4f76572555c28afd1a0a0baf33e49de9f6984e84
authored
2013-05-04 12:07:39 -0600
by
hexid
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Change getElementsAttribute to use Array.map()
1 parent
a41a81c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
modules/casper.js
modules/casper.js
View file @
4f76572
...
...
@@ -909,12 +909,9 @@ Casper.prototype.getElementsAttr = function getElementsAttr(selector, attribute)
"use strict"
;
this
.
checkStarted
();
return
this
.
evaluate
(
function
_evaluate
(
selector
,
attribute
)
{
var
ele
=
[];
[].
forEach
.
call
(
__utils__
.
findAll
(
selector
),
function
(
element
)
{
var
e
=
element
.
getAttribute
(
attribute
);
ele
.
push
(
e
);
return
Array
.
prototype
.
map
.
call
(
__utils__
.
findAll
(
selector
),
function
(
element
)
{
return
element
.
getAttribute
(
attribute
);
});
return
ele
;
},
selector
,
attribute
);
}
...
...
Please
register
or
sign in
to post a comment