Tricky Jquery Question!
<p>What I want to achieve. If the Url for certain emplyees does not exists then instead of displaying an error page I do not want to show the link itself for that employee. I have done it in 2 different ways and none of them are working. Please help. I have the entire code below. All of it is working except for the url part for ones with no html page that my link can connect to. Please help!!</p>

<pre><code>function test(a,b) {

    var Name = a.text();
    $.ajax({
        type: "POST",
        url: "EmpServices.asmx/GetInfo",
        data: '{ "fieldName": "' + a.attr("id") + '"}',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(results) {
            //            if (results.d.Url.length &lt; 2)
            //            {
            //               $('#url').hide();
            //            }
            if (results.d.EmpName.length &gt; 1) {
                var html = '&lt;div style="width:25%;"&gt;&lt;img src="' + results.d.image + '" /&gt;&lt;/div&gt;'
                    + '&lt;div  style="width:75%;"&gt;'
                    + '&lt;div&gt;&lt;h3&gt;' + results.d.EmpName + '&lt;/h3&gt;&lt;/div&gt;'
                    + '&lt;/div&gt;';
                //+ '&lt;div id="url"&gt;&lt;a href="' + results.d.Url+ '"&gt;Info&gt;&lt;/a&gt;&lt;/div&gt;';

                if (results.d.Url.length &lt; 2) 
                {
                    html += '&lt;div id="url"&gt;&lt;a href="' + results.d.Url+ '"&gt;Info&gt;&lt;/a&gt;&lt;/div&gt;';
                }
                $(Employee).html(html);

            }
        },
        error: function() {
            $(Employee).html('Error');
        }
    });
}
</code></pre>
