title: Why does this JavaScript cause a "Permission Denied" error in IE
body: <p>The following code throws a <code>Permission Denied</code> 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 Firefox — 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 <code>cufon-yui.js</code> (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>