<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
var ipinfo;
$.getJSON("https://ipinfo.io", function (data) {
$("#info").append("City: " + data.city + " <br>,County: " + data.country + " ,IP: " + data.ip + " <br>,,Location: " + data.loc + " <br>,,Organisation: " + data.org + " <br>,,Postal Code: " + data.postal + " <br>,,Region: " + data.timezone + "")
})
</script>
</head>
<body>
<p>Client's information:</p>
<p id="info"></p>
</body>
</html>
So this display the ip information. My question how can add this to an ajax
event data: $(this).serialize();
So how to paste it also send form serialized data but still ip information from getJSON
?
$.ajax({
type: "POST",
url: "url",
data: $(this).serialize()
});
Thanks!