How to convert this javascript code in to jquery
<pre><code>if (window.parent.frames['scripts1']) {
  if (window.parent.frames['scripts1'].document.documentElement) {
    var strSCRIPT = window.parent.frames['scripts1'].document.documentElement.textContent;
    if ((strSCRIPT.lastIndexOf('bbbbEND') - strSCRIPT.length) != -7) {
      window.parent.frames['scripts1'].document.location.href = 'test1.txt?refresh=' + Date();
    }
  } else {
    window.parent.frames['scripts1'].document.location.href = 'test1.txt?refresh=' + Date();
  }
}
</code></pre>

<p>I have tried lot of things but not success in writing something for cross browser.</p>
