Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / phantomjs / lib / phantom / examples / ipgeocode.js
1 // Give the estimated location based on the IP address.
2
3 cb = function (data) {
4     var loc = data.city;
5     if (data.region_name.length > 0)
6         loc = loc + ', ' + data.region_name;
7     console.log('IP address: ' + data.ip);
8     console.log('Estimated location: ' + loc);
9     phantom.exit();
10 };
11
12 var el = document.createElement('script');
13 el.src = 'http://freegeoip.net/json/?callback=cb';
14 document.body.appendChild(el);