summaryrefslogtreecommitdiffstats
path: root/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.js')
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.js
new file mode 100644
index 00000000..6bf5a9fc
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.js
@@ -0,0 +1,19 @@
+// Read the Phantom webpage '#intro' element text using jQuery and "includeJs"
+
+var page = require('webpage').create();
+
+page.onConsoleMessage = function(msg) {
+ console.log(msg);
+};
+
+page.open("http://www.phantomjs.org", function(status) {
+ if ( status === "success" ) {
+ page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() {
+ page.evaluate(function() {
+ console.log("$(\"#intro\").text() -> " + $("#intro").text());
+ });
+ phantom.exit();
+ });
+ }
+});
+