[英]display content of a URL in a div
我打開一個彈出窗口,格式如下:
window.open('http://URL', 'invitationwindow', 'height=250,width=500,scrollbars=yes,resizable=yes,status=yes')
我該如何在同一頁面的div中獲取彈出窗口的內容。 我的意思是,我不想要彈出窗口,但它的內容應該顯示在彈出窗口的同一頁面中。
如何使用Jquery完成? 我知道.append()
和.html()
會向div添加內容,但在這種情況下,我會從http://example.com等網址獲取內容。
謝謝!
使用jquery load()
:
$('#mydiv').load('http://URL');
通常人們會使用<iframe>
。
使用jquery,使用:
$.get('ajax/test.html', function(data) {
$('.result').html(data);
alert('Load was performed.');
});
和
$('#result').load('ajax/test.html', function() {
alert('Load was performed.');
});
希望能幫助到你!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.