Get User IP By jQuery Ajax

/ Published in: JavaScript
Save to your folder(s)

Get User IP By jQuery Ajax

Copy this code and paste it in your HTML
  1. function GetUserIP(){
  2. var ret_ip;
  3. $.ajaxSetup({async: false});
  4. $.get('//', function(r){
  5. ret_ip = r.ip;
  6. });
  7. console.log(ret_ip)
  8. return ret_ip;
  9. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.