Here is an api that gives ip address.
https://jsonip.com/
I want ip address in variable for my application. I can get it like that
window.onload = function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://jsonip.com/?callback=DisplayIP";
document.getElementsByTagName("head")[0].appendChild(script);
};
function DisplayIP(response) {
document.getElementById("ipaddress").innerHTML = "Your IP Address is " +
response.ip;
alert(response.ip); // alerts ip address
}
I have to use it with Sharpspring forms so the above method can't be integrated with sharpspring code. I want something like that
var ip = 'ip address';
For your easy understanding, here is the sharpspring form code
<script type="text/javascript">
var ss_form = {'account': 'MzawMDEzNjI0BwA', 'formID': 'SzQ1MTAzSEzSNTG2NNQ1STJN1k1KMjfVNTIzSwbCJKMUS2MA'};
ss_form.width = '100%';
ss_form.height = '1000';
ss_form.domain = 'app-3QNBWW1ZDA.marketingautomation.services';
ss_form.hidden = {'field_3270188034': 'ip address'}; //here I want to use that ip
</script>
<script type="text/javascript" src="https://koi-3QNBWW1ZDA.marketingautomation.services/client/form.js?ver=1.1.1"></script>
ss_formused later? Is it a hardcoded global variable read by thekoi-...script?ss_form.hiddenin the DisplayIPfunction?