Using try block to catch 'sameorigin' error when loading iframe
<p>Got a script that takes urls from a txt file and puts them in an iframe one after another. Heres the script:      </p>

<pre><code> &lt;script type="text/javascript"&gt;
           $.get("imones.txt", function (data) {
                var array = data.split(/\r\n|\r|\n/);
                var beforeLoad = (new Date()).getTime();
                var loadTimes = []; 
                    var beforeTimes = [];   
                $('#frame_id').on('load', function () {                                 
                    beforeTimes.push(beforeLoad);
                    loadTimes.push((new Date()).getTime()); 
                    $('#frame_id').attr('src', array.pop()); 
                        $.each(loadTimes, function (index, value) {
                            var result = (value - beforeTimes[index]) / 1000; 
                                if (result &lt; 0) { 
                                    result = result * (-1);
                                }   
                            $("#loadingtime" + index).html(result);
                            beforeLoad = value;
                        });
                }).attr('src', array.pop());
            });
        &lt;/script&gt;
</code></pre>

<p>Im encountering a problem when one of the urls has 'same origin' protection (google.com for example), my problem is that it wont load any other frames once it starts loading google (it get stuck). I was told to try using a <code>try catch</code> block for this, but i dont know how. How do i use the <code>try catch</code> to avoid the 'same origin' urls (note that i dont want them to load, i want them to skip).</p>
