arguments.js: Dump all arguments passed to the script.

1.0
Ariya Hidayat 2010-12-26 22:40:07 -08:00
parent 5c05acd986
commit 160c4128d8
1 changed files with 8 additions and 0 deletions

8
examples/arguments.js Normal file
View File

@ -0,0 +1,8 @@
if (phantom.arguments.length === 0) {
phantom.log('Try to pass some arguments when invoking this script!');
} else {
phantom.arguments.forEach(function (arg, i) {
phantom.log(i + ': ' + arg);
});
}
phantom.exit();