DhrubaJyoti
DhrubaJyoti

Reputation: 1953

How two different domains to be viewed in the single browser?

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

Upvotes: 0

Views: 249

Answers (5)

symcbean
symcbean

Reputation: 48387

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

Upvotes: 0

user244774
user244774

Reputation:

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

Upvotes: 0

XpiritO
XpiritO

Reputation: 2827

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

Upvotes: 2

Frunsi
Frunsi

Reputation: 7157

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">
<html>
<head>
<title>This &amp; That</title>
</head>
<frameset cols="50%,50%">
  <frame src="http://site1.example.com/">
  <frame src="http://site2.example.com/">
</frameset>
</html>

Upvotes: 6

Carl Smotricz
Carl Smotricz

Reputation: 67820

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.

Upvotes: 5

Related Questions