Jquery 无法更改iframe的src
我做错了什么?我尝试了以下方法,但在iframe中什么也没有得到Jquery 无法更改iframe的src,jquery,ipad,iframe,Jquery,Ipad,Iframe,我做错了什么?我尝试了以下方法,但在iframe中什么也没有得到 var file = "TreeImages/" + $(this).text() + ".pdf'"; var file = "/TreeImages/" + $(this).text() + ".pdf'"; var file = ".../TreeImages/" + $(this).text() + ".pdf'"; //with/... $('div.viewer.ifrm').attr('src') = file;
var file = "TreeImages/" + $(this).text() + ".pdf'";
var file = "/TreeImages/" + $(this).text() + ".pdf'";
var file = ".../TreeImages/" + $(this).text() + ".pdf'";
//with/...
$('div.viewer.ifrm').attr('src') = file;
$('div.viewer.ifrm').attr('src', file);
iframe的html如下所示
<div class="wrapper">
<div class="treeMenu" ></div>
<div class="viewer">
<iframe class='ifrm' scrolling='yes' src=''></iframe>
</div>
</div>
如果我删除并添加整个iFrame,而不是试图更改源代码,我就可以让事情顺利进行,但当我尝试使用时,这似乎会导致iPad上的滚动中断-webkit overflow scrolling:touch 您希望选择器之间留有空格,以表明它们不是同一元素的多个类
$('.viewer .ifrm').attr('src', file);
Does
$('iframe.ifrm').attr('src')=文件代码>$('iframe.ifrm').attr('src',文件)代码>工作?当然可以将选择器用作“div.viewer.ifrm”。呸!有时透过树木看不见森林。谢谢