Better naming
Let's put real errors in the console
The console will tell us it is an error

No need to say it twice!
Let's tell what the real problem is
Add some empty lines for reading
Better url testing

Will improve even more later.
Only console.error is called in our code, the rest is obsolete
Smarter numeric methods
Correct check
Formatting