Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以获取 ajax 响应并将其显示在动态 iframe 中作为 iframe 内容..?
这是代码的一部分:
$('.ifrm').html('response') <iframe class='ifrm' src="abcd.php"></iframe> It would be a great help if anyone tells me how to do it.. Thanks!
$('iframe#myFrame').load(function(){ $(this).contents().find('div.myClass').append("Hallo, Welt!"); });
您可以使用正确的 URL 在按钮单击时调用它:
$(docIFrameId).empty().attr('src', <urlHere>, function () { // ... });
注意:将<urlHere>部分替换为正确的 URL
<urlHere>