Why does jQuery dead link removal code removes all links?
<p>This code checks for dead links. Since 3rd party Ajax requests are not allowed by browsers, I created a php file to check for dead links and my native jQuery code is:</p>

<pre><code>function UrlExists(urlx) {
    $.ajax({
        url: "/chk.php?url=" + encodeURIComponent(urlx),
        cache: false,
        method: 'get',
        success: function (data) {
            if (data.indexOf("T") != -1) {
                return true;
            }
            else {
                return false;
            }
        }
    });
}
$(document).ready(function () {
    $("table[id^='row']").each(function () {
        if (!UrlExists($(this).find("a[href$='mp3']").attr('href'))) {
            $(this).remove();
        }
    })
});
</code></pre>

<p>While, I have made sure that </p>

<p>1) <code>chk.php</code> is working properly and return <code>T</code> on some URLs and on others not.</p>

<p>2) Old JS code is not being used</p>

<p>Still the problem is that above program removes all links. I also tried setting <code>async</code> to false but it does'nt help. </p>
