0

我想知道是否可以获取 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!
4

2 回答 2

1
$('iframe#myFrame').load(function(){
  $(this).contents().find('div.myClass').append("Hallo, Welt!");
});
于 2013-07-05T08:33:47.643 回答
0

您可以使用正确的 URL 在按钮单击时调用它:

$(docIFrameId).empty().attr('src', <urlHere>, function () {
    // ...
});

注意:将<urlHere>部分替换为正确的 URL

于 2019-08-14T12:53:15.273 回答