Url validation with jquery
<p>Why in following code don't work this part <code>if(!$(this).val()){...</code> from code and this match is true with <code>http://www.st</code>, i want as: <code>http://stackoverflow.com</code> ?</p>

<p><strong>Example:</strong> <a href="http://jsfiddle.net/gp9nL/3/" rel="nofollow">http://jsfiddle.net/gp9nL/3/</a></p>

<pre><code>$('.url').keyup(function(){
    if (!$(this).val().match(/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \?=.-]*)*\/?$/)){
        $(this).css("background", "#ffc4c4");
        result = false;
    }else {
        $(this).css("background", "#FFFFEC");
        result = true;
    }
    if(!$(this).val()){
        alert('field is empty')
        $(this).css("background", "#FFFFEC");
    }
    return result;
});
</code></pre>
