views:

156

answers:

3

Put all contents on another web page into a fixed size div.

How to achieve this?

+4  A: 

You can use an IFrame HTML element. Otherwise, the browsers' cross-domain policy will be triggered (i.e. it cannot be achieved through javascript, unless you rely on a server-side proxy).

Alexander Gyoshev
A: 

Create a server side proxy to do a http web request. Call your proxy method using an ajax request.

redsquare
A: 

You can use jQuery (www.jquery.com):

$(function() {
    $('#fixedSizeDiv').load("test.htm");
});

HTML:

<div id="fixedSizeDiv"></div>

For more information about jQuery.load, head over to http://docs.jquery.com/Ajax/load#urldatacallback

Mickel
Can it be used to load part of DOM and scale it accordingly?
Shore
I mean the same page,but different part.
Shore
Yes, you can use standard jQuery selectors in the url (test.html in my example). So if you'd like the dom in the div with id #coolio, you'd write the url "test.html #coolio". Helpful? Remember to check as answer.
Mickel