【发布时间】:2018-04-05 19:06:19
【问题描述】:
我想在我的 scala 播放视图中显示这个 iframe;
<iframe src="http://localhost:9020/index.html#/group/sectiona/sectionb">Loading...</iframe>
如果我对这个网址进行硬编码,它就可以工作。但我希望它是动态的。我试过了;
<iframe src="http://localhost:9020/index.html#/group/{{ 'http:\//localhost:9020\/#\/group\/' + myclass.section + '\/' + myclassb.section }}/testtopic">Loading...</iframe><iframe src="http://localhost:9020/index.html#/group/{{myclass.section}}/sectionb">Loading...</iframe><iframe class="graphiframe" src="{{ 'http:\//hello' + myclass.section + 'world'}}" frameborder="0" style="overflow:hidden" height="100%" width="100%">Loading...</iframe><iframe class="graphiframe" src="{{ 'http://hello' + myclass.section + 'world'}}" frameborder="0" style="overflow:hidden" height="100%" width="100%">Loading...</iframe>
等等。
这些都不起作用。在 4 和 5 中,当我检查元素时,整个 src 都从 iframe 中消失了,我得到了一个 iframe,分别带有错误消息 Action not found. For request 'GET /%7B%7B%20'http:///hello'%20+%20myclass.section%20+%20'world'%7D%7D' 和 Action not found. For request 'GET /%7B%7B%20'http://hello'%20+%20myclass.section%20+%20'world'%7D%7D'。我在 application.conf 中进行了更改,例如 play.filters.headers.frameOptions = null。它使用 Play 2.4.0。
我该如何解决这个问题?
【问题讨论】:
标签: java scala iframe playframework playframework-2.0