Closed yasinuslu closed 6 years ago
When using evaluate() function we should be able to use a callback function for async functions.
phantomProxy.create({}, function (proxy) { var page = proxy.page; page.open('http://www.w3.org', function () { page.includeJs('http://code.jquery.com/jquery-latest.js', function() { page.evaluate(function(callback) { $.get('http://google.com', function() { var data = 'some async data'; callback(data); }); }, function(result) { console.log(result); // will output 'some async data' }); }); }); });
I considered using evaluateSync() but it doesn't have any option to return a data.
When using evaluate() function we should be able to use a callback function for async functions.
I considered using evaluateSync() but it doesn't have any option to return a data.