<!-- jQuery library URL path -->
<script type="text/javascript">
// KickFire IP Detection Endpoint
$(document).ready(function() {
$.getJSON('//api.kickfire.com/ip',{ipkey:'xxxxxx'},function(ip) {
console.log(ip);
});
});
</script>
The Document Object Model (DOM) is the programming interface that for HTML, XHTML, or XML documents.
Simply put, it connects web pages to programming languages or scripts.
A web page is simply a document that can be viewed in the browser window or as HTML source code. The DOM provides another representation of the same document and defines ways that programs can access the document to store or manipulate the content, style or structure.
Detecting an IP address through server-side language such as PHP, Java, etc. is the best practice. There are many examples using Remote-Addr and X-Forwarded-For that can be found with a quick Google search.
// PHP example to detect IP address
if (!empty($_SERVER["HTTP_CLIENT_IP"])) {
// Check for ip from share internet
$ip = $_SERVER["HTTP_CLIENT_IP"];
}
elseif (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
// Check for the Proxy User
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}
else {
// Couldn't find anything so go with this
$ip = $_SERVER["REMOTE_ADDR"];
}
KickFire is the leader in IP address intelligence, company identification technology and cloud-based B2B sales automation. The KickFire solutions are powered by TWIN Caching, an advanced, proprietary IP-to-company identification technology.