rajesh
rajesh

Reputation: 1433

How to get external pages into div?

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...

Upvotes: 0

Views: 268

Answers (2)

Amr Badawy
Amr Badawy

Reputation: 7693

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, '')) 

Upvotes: 1

erikvold
erikvold

Reputation: 16558

This sounds like what iframes are for.

Upvotes: 0

Related Questions