Dr J R Stockton <> wrote in news:qaYF
$:
> But some strings, liable to be entered in error, can be ruled out as
> possible URLs by a local check, with more or less confidence.
True. But the most common types if miss-spelling (as well as the most
common spells of miss-typing) will not be within the "http://" part of the
URL, which might not even be there if it is assumed to be such by the
application. Usually an error will be an ommission, duplication, or
transposition of alphanumeric characters. Mistakes such as this will always
evaluate as valid and will need to be run through the network in any case.
In other words, yes, you can very quickly (client side) notice it when a
"." has been entered as a ",". But most typing mistakes will not be
noticed. Is it worth making your code more complicated to do this?
It will not speed up the obligatory check which will need to be done
afterwards. And it introduces more code which increases the chance of your
user seeing one of those pesky JS error boxes.
--
http://pages.videotron.ca/duffym/index.htm#