How to get client's IP address using JavaScript?

I was trying to use the cloudflare code to access client IP which is mentioned in below link.
Now I just wanted to understand, Is there any impact while using this? Like, restricted to number of visit/any chance of attack/Is this paid service, etc. Please help.

$.get('', function(data) {
  // Convert key-value pairs to JSON
  data = data.trim().split('\n').reduce(function(obj, pair) {
    pair = pair.split('=');
    return obj[pair[0]] = pair[1], obj;
  }, {});

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.