My website looks up different IP Addresses to see if they are a known threat. I am putting a button in that is linked through Vue.js and on click, I want it to push the user's IP Address to the input box. I am having a lot of trouble trying to get the user's ip address.
In addition, I do not want any jquery since there is an error thrown whenever I try to use it.
This is an abridged version of my js code:
let app = new Vue({
el: '#app',
data: {
term: localStorage.getItem("searchTerm")
},
methods: {
showYourIP()
{
this.term = //User's IP Address
}
}});
Html that calls it is:
<button class="button" id="yourIP" @click="showYourIP">Show Your IP</button>
Here is a link to my site so it's easier to understand what I'm trying to do: https://people.rit.edu/sns9181/igme330/Threat-Visualizer/
You can look through my whole code there by right clicking and inspecting the page if that is easier.