views:

115

answers:

6

I have two different application having different domains, want to make a site where its show both sites in a single page.[Without using Iframe].

+5  A: 

Too bad - IFRAMEs would be a simple and effective solution.

Another reasonably simple solution would be to use a 3rd server, one of your own, to aggregate pages from the other two.

I can't think of a sensible way to do this in the client browser without IFRAMEs.

Carl Smotricz
How to aggregate pages ?
DhrubaJyoti
You'd write a Web app that itself acts as a HTTP client to 2 or more other sites, pulls in their text, combines it into a single document and returns that to the original client's browser.
Carl Smotricz
@DhrubaJyoti Aggregating pages is the easy part - I'd like to know how you're going to display them with out frames/iframes.
meagar
Heh, once you have all the content, you can re-arrange their DIVs any way you please. That's definitely not hard, assuming you know the other guys' page structure. Even if you don't, you could display the 2 pages side by side in a table or something.
Carl Smotricz
Getting their CSS, JS, etc. not to affect each other could be tough, though. Lots of post-processing and nasty edge cases involved, plus issues with CSS positioning, differing doctypes, and more.
ceejayoz
Well, we're assuming those pages are not purely random but well known in their structure, if not their exact content.
Carl Smotricz
+4  A: 

You could use good old frames (not IFRAME):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd"&gt;
<html>
<head>
<title>This &amp; That</title>
</head>
<frameset cols="50%,50%">
  <frame src="http://site1.example.com/"&gt;
  <frame src="http://site2.example.com/"&gt;
</frameset>
</html>
frunsi
+1 for "not IFRAME"
ohnoes
Yea, pretty much the last valid use for frames, IMO.
meagar
Hehe, nice answer! +1 (but out of votes)
Carl Smotricz
I didn't know you could run out of votes?
Peter Di Cecco
Max is 10 per day (or a bit above that). You apparently just don't vote that much ;)
BalusC
30, actually. On a busy day I run out.
Carl Smotricz
+2  A: 

Check out this example in DynamicDrive website. It uses AJAX to dynamically load the content of an HTML page into a DIV element. This will only work for local files (trying to include one page into another page on the same domain), but if you may use PHP on server-side, you can use jQuery to solve this out (check out this article).

XpiritO
A: 

you cannot not display diffrent domains in the same page without iframes or frames. The cannot be bceuse of browser security.

Husam
A proxy script allows you to bypass this.
ceejayoz
A: 
<h1>Welcome to site A</h1>
Here is the weather from site B <hr />
<?php
   include("http://siteb.com/weather.htm");
?>

Of course, in practice you'd need to parse the DOM returned from siteB to ensure that the composite output was well formed - i.e. stripping out the ... and XML sugar. And strip out or erqrite any references to files on siteb contained within the HTML - such as javascript, images etc.

And bear in mind that this is going to break any fancy CSS.

C.

symcbean
A: 

Use this answer

but just add another AJAX call for the second website. Then use a simple proxy to beat the cross-domain security built into the browser. Some thing like this in PHP:

<?php
header('Content-Type: text/plain');
$html = file_get_contents("http://siteb.com")
echo $html;
?>
Martin Hoegh