Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Mozilla サポートの検索

サポート詐欺に注意してください。 私たちはあなたに通話やショートメッセージの送信、個人情報の共有を求めることはありません。疑わしい行為を見つけたら「迷惑行為を報告」からご報告ください。

詳しく学ぶ

このスレッドはアーカイブに保管されました。 必要であれば新たに質問してください。

Document not defined in iframe Firefox

  • 1 件の返信
  • 3 人がこの問題に困っています
  • 198 回表示
  • 最後の返信者: guigs
  • アーカイブに保管済み

Hello, i am having an issue with firefox when i am trying to evaluate javascript in side the href of an anchor in an iframe. I know that is not good practise but its the only practise open to me with SSRS. The code evaluates correctly when the page is not open within an iframe, but when within an iframe i get a

exception: ReferenceError: document is not defined

You can see the code running in page.png and the failure in iframe.png I have the same question in stackoverflow. And at the end i am attaching the code of the button.


http://stackoverflow.com/questions/32267132/document-not-defined-in-iframe-firefox




<a tabindex="1" href="javascript:eval%20(%20%20%20%20%20unescape%20%20%20%20%20('var%20elementIterator%20=%20document.evaluate(%20%5C'%5C/%5C/tr%5B@isparameterrow=%5C%5C%5C'true%5C%5C%5C'%5D%5C/td%5C/label%5C/span%5C'%20,document,%20null,%20XPathResult.ANY_TYPE,%20null%20);%5Cr%5Cn%20%20%20%20var%20params%20=%20%5B%5D%5Cr%5Cn%20%20%20%20while%20(elem__%20=%20elementIterator.iterateNext())%20%7B%5Cr%5Cn%20%20%20%20%20%20%20%20var%20param=%7B%7D;%5Cr%5Cn%20%20%20%20%20%20%20%20console.log(elem__.innerHTML);%5Cr%5Cn%20%20%20%20%20%20%20%20var%20elem_val%20=%20elem__.parentElement.parentElement.nextSibling.firstChild.firstChild.nextSibling;%5Cr%5Cn%20%20%20%20%20%20%20%20switch(elem_val.type)%20%7B%5Cr%5Cn%20%20%20%20%20%20%20%20case%20%5C'text%5C':%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20param%5Belem__.innerHTML%5D%20=%20elem_val.value%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20console.log(elem_val.value)%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20break;%5Cr%5Cn%20%20%20%20%20%20%20%20case%20%5C'select-one%5C':%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20param%5Belem__.innerHTML%5D%20=%20elem_val.options%5Belem_val.selectedIndex%5D.innerHTML%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20console.log(elem_val.options%5Belem_val.selectedIndex%5D.innerHTML)%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20break;%5Cr%5Cn%20%20%20%20%20%20%20%20case%20undefined:%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20param%5Belem__.innerHTML%5D%20=%20elem_val.firstChild.nextSibling.value.replace(%5C/;%5C/g%20,%20%5C',%5C')%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20console.log(elem_val.firstChild.nextSibling.value)%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20break;%5Cr%5Cn%20%20%20%20%20%20%20%20default:%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20param%5Belem__.innerHTML%5D%20=%20%5C'ALL%5C'%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20console.log(%5C'unknown%5C')%5Cr%5Cn%20%20%20%20%20%20%20%20%7D%5Cr%5Cn%20%20%20%20%20%20%20%20params.push(param)%5Cr%5Cn%20%20%20%20%7D%5Cr%5Cn%20%20%20%20console.log(JSON.stringify(params))%5Cr%5Cn%20%20%20%20window.parent.postMessage(JSON.stringify(params),%20%5C'*%5C');')%20)" style="text-decoration:none;" target="_top"></a>

Hello, i am having an issue with firefox when i am trying to evaluate javascript in side the href of an anchor in an iframe. I know that is not good practise but its the only practise open to me with SSRS. The code evaluates correctly when the page is not open within an iframe, but when within an iframe i get a exception: ReferenceError: document is not defined You can see the code running in page.png and the failure in iframe.png I have the same question in stackoverflow. And at the end i am attaching the code of the button. http://stackoverflow.com/questions/32267132/document-not-defined-in-iframe-firefox <a tabindex="1" href="javascript:eval%20(%20%20%20%20%20unescape%20%20%20%20%20('var%20elementIterator%20=%20document.evaluate(%20%5C'%5C/%5C/tr%5B@isparameterrow=%5C%5C%5C'true%5C%5C%5C'%5D%5C/td%5C/label%5C/span%5C'%20,document,%20null,%20XPathResult.ANY_TYPE,%20null%20);%5Cr%5Cn%20%20%20%20var%20params%20=%20%5B%5D%5Cr%5Cn%20%20%20%20while%20(elem__%20=%20elementIterator.iterateNext())%20%7B%5Cr%5Cn%20%20%20%20%20%20%20%20var%20param=%7B%7D;%5Cr%5Cn%20%20%20%20%20%20%20%20console.log(elem__.innerHTML);%5Cr%5Cn%20%20%20%20%20%20%20%20var%20elem_val%20=%20elem__.parentElement.parentElement.nextSibling.firstChild.firstChild.nextSibling;%5Cr%5Cn%20%20%20%20%20%20%20%20switch(elem_val.type)%20%7B%5Cr%5Cn%20%20%20%20%20%20%20%20case%20%5C'text%5C':%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20param%5Belem__.innerHTML%5D%20=%20elem_val.value%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20console.log(elem_val.value)%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20break;%5Cr%5Cn%20%20%20%20%20%20%20%20case%20%5C'select-one%5C':%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20param%5Belem__.innerHTML%5D%20=%20elem_val.options%5Belem_val.selectedIndex%5D.innerHTML%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20console.log(elem_val.options%5Belem_val.selectedIndex%5D.innerHTML)%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20break;%5Cr%5Cn%20%20%20%20%20%20%20%20case%20undefined:%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20param%5Belem__.innerHTML%5D%20=%20elem_val.firstChild.nextSibling.value.replace(%5C/;%5C/g%20,%20%5C',%5C')%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20console.log(elem_val.firstChild.nextSibling.value)%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20break;%5Cr%5Cn%20%20%20%20%20%20%20%20default:%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20param%5Belem__.innerHTML%5D%20=%20%5C'ALL%5C'%5Cr%5Cn%20%20%20%20%20%20%20%20%20%20%20%20console.log(%5C'unknown%5C')%5Cr%5Cn%20%20%20%20%20%20%20%20%7D%5Cr%5Cn%20%20%20%20%20%20%20%20params.push(param)%5Cr%5Cn%20%20%20%20%7D%5Cr%5Cn%20%20%20%20console.log(JSON.stringify(params))%5Cr%5Cn%20%20%20%20window.parent.postMessage(JSON.stringify(params),%20%5C'*%5C');')%20)" style="text-decoration:none;" target="_top"><img onload="this.fitproportional=true;this.pv=0;this.ph=0;" src="/ReportServer/Reserved.ReportViewerWebControl.axd?ExecutionID=m2epq5m3tb5utoiypx3rnlq2&amp;Culture=2057&amp;CultureOverrides=False&amp;UICulture=9&amp;UICultureOverrides=False&amp;ReportStack=1&amp;ControlID=b385c121b40f4554a1f5c14eeb885529&amp;OpType=ReportImage&amp;IterationId=b3aeb408b2014a51bcea7277af910bf1&amp;StreamID=d5faf78f-1783-4393-b5c8-26f9afbdebb6" border="0" height="35" width="93"></a>
添付されたスクリーンショット

すべての返信 (1)