-2
I need a JS application to which I should compare 2 Ips .
Initial numbers must be equal but the end of 1 IP must always be greater than the second
Example:
10.200.1.6 > 10.200.1.2 = true
My code:
var rangeInicio = '10.200.1.6';
var splits = rangeInicio.split('.', 4);
console.log(splits);
var rangeFim = '10.200.1.2';
var splits = rangeFim.split('.', 4);
console.log(splits);
function myFunction() {
var rangeInicio = "10.200.1.6";
var rangefim = "10.200.1.2";
var n = rangeInicio.localeCompare(rangeFim);
document.getElementById("demo").innerHTML = n;
}
$(document).ready(function("demo") {
$("#more").click(function ("demo") {
It would be nice to put more information and code that is using
– Otto
You want someone to make this application for you?
– Jéf Bueno
@Click [Dit] and format your question. You can’t understand anything with these loose comments.
– Jéf Bueno
Edited commentary
– hiago
Related https://answall.com/questions/88463/problemas-com-uncaught-referenceerror-is-not-defined
– Daniel Gentil