当サイトはユーザー体験を改善するためのメンテナンスを実施中に機能が制限される予定です。記事を読んでもあなたの問題が解決せず質問をしたい場合は、Twitter の @FirefoxSupport、Reddit の /r/firefox で、サポートコミュニティが皆さんを助けようと待機しています。

Mozilla サポートの検索

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

詳しく学ぶ

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

Document not defined in iframe Firefox

  • 1 件の返信
  • 3 人がこの問題に困っています
  • 1 回表示
  • 最後の返信者: guigs

more options

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)

more options