开发者

How to get external pages into div?

开发者 https://www.devze.com 2023-01-05 00:38 出处:网络
i tried for including external page in div in my home page but the problem 开发者_高级运维is that external page is developed in ajax means that if we click any link inside that external it doesn\'t ch

i tried for including external page in div in my home page but the problem 开发者_高级运维is that external page is developed in ajax means that if we click any link inside that external it doesn't change URL . My problem is that when i included that page in my code using code on link. http://www.javascriptkit.com/script/script2/ajaxpagefetcher.shtml

it doesn't show images and when i click any link it also doesn't work..

Please suggest some solution.

Thanks...


can use this JavaScript method to get content of any page and set it to div

function CallPageSync(url, data) {
    var response;
    $.ajax({
        async: false,
        url: url,
        data: data, // parameters
        timeout: 4000,
        success: function(result) {
            response = result;
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
           response = "err--" + XMLHttpRequest.status + " -- " + XMLHttpRequest.statusText;
        }
    });
    return response;
}


$('contentDiv').html(CallPageSync(url, '')) 


This sounds like what iframes are for.

0

精彩评论

暂无评论...
验证码 换一张
取 消