Removing elements in jQuery results in error
<p>I have a page with lots of tables, each with a link inside. I had to check if they are dead or not so i build this code:</p>

<pre><code>    function UrlExists(url)
    {
        var http = new XMLHttpRequest();
        http.open('HEAD', url, false);
        http.send();
        return http.status!=404;
    }

    $(document).ready(function() {
        $("table[id^='row']").each(function(){
            if(!UrlExists($(this).children("a:nth-child(2)").attr('href')))
                $(this).remove();
        })
    });
</code></pre>

<p>But it doesn't seem to work and even the error console is not helpful:</p>

<pre><code>Error: ($(parentElement) || document.body).getElementsByTagName is not a function
Source File: http://..../js/prototype.js
Line: 835
</code></pre>

<p>Where I am wrong?</p>
