Why does this javascript cause "Permission Denied" error in IE
<p>The following code throws a "Permission Denied Error in IE, citing jquery (1.6.2) line 6244 Char:2</p>

<pre><code>function addAgreement() {
  var url = window.location.toString();
  var pieces = url.split('/');
  var site_url = url.replace(pieces[pieces.length -1], '');

  $('.login').append('&lt;div id="dialog"&gt;&lt;/div&gt;');
  $('#dialog').load(site_url + '?page_id=443');
}

  $('#dialog').dialog({
        width: 800,
        position: 'top',
        modal: true,
        buttons: {
                    "Agree": function() { 
                        agreed = true;
                        var val = $('#registerform').attr('action') + '&amp;agreed=1';
                        $('#registerform').attr('action', val);
                        $(this).dialog("close");
                        $('#registerform').trigger('submit');
                    }, 
                    "Disagree": function() { 
                        agreed = false;
                        $(this).dialog("close"); 
                    } 
                }
    });
</code></pre>

<p>It works in FF - is this something to do with same origin policy? jQuery is being served by Google CDN.</p>

<p><strong>UPDATE</strong>
The content being loaded is a wordpress page which also contains includes for cufon-yui.js (served locally). I have tried serving jquery locally too (i.e not from the Google CDN) and this made no difference.</p>

<p><strong>UPDATE 2</strong> removing the following script tags from the loaded page stops the error from appearing.</p>

<pre><code>&lt;script type='text/javascript' src='&lt;?php echo bloginfo( 'template_url' ) ?&gt;/inc/js/cufon-yui.js'&gt;&lt;/script&gt; 
&lt;script type='text/javascript' src='&lt;?php echo bloginfo( 'template_url' ) ?&gt;/inc/js/path/to/font.js'&gt;&lt;/script&gt;
&lt;script type='text/javascript'&gt;
Cufon.replace('#page')('.title');

&lt;/script&gt; 
</code></pre>
