View Full Version : window.open->getElementById.open

02-02-2009, 07:27 PM
Hi everybody!
Is this possible to open the document, not in a new window, like this - javascript:window.open(...)
but in the same page, in div, which we will take with getElementById.

I mean: document.getElementById('name_of_div').open(...)

02-02-2009, 08:38 PM
I have just made it with iframe.

02-03-2009, 03:43 AM
You can use ajax even for this purpose. I mean you can make an ajax call to the server, get the page content and insert the content in a div in your page.

Sure iframes will do but they'll load it as a different page itself, a separate window in the main window. Moreover iframes has its own issues especially cross-browser.

02-03-2009, 03:45 AM
yes, you can use ajax, it is imposible to do like what you want kofg

02-03-2009, 03:59 AM
Maybe this (http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm)?

02-03-2009, 04:32 AM
hi nile, DHTML window widget is also use iframe that inserted to div.

so , kofgarter can open onother page on his div bu inserting iframe (that containing targeted url of page ) to his div.

02-03-2009, 07:21 AM
Widget can also use AJAX, four ways actually:

Four types of content supported within each window: 1) Inline Text, 2) HTML from an invisible DIV on the page, 3) An external page shown inside an IFRAME, or 4) An external page on the same site fetched via Ajax.

But for another page, it requires AJAX or iframe. However, with AJAX (Widget AJAX or other AJAX), scripts on the imported page are generally not run, and stylesheets on the imported page are generally not followed. Also, with AJAX, paths on the the external page, if relative, must be relative to the 'top' page.