View Full Version : hyperlink to external domain div

10-24-2011, 12:54 PM
Basicly i have the following problem.

I have to sites:

1 site i own
2 other external domain site with webshop. Exists of left div (menu), middle div (content), right div (ads)

Now i want to create a link on site 1 that displays only the content div of site 2 in an iframe of my own website. - This means cross-site or cross-domain scripting. - I can display the whole page in an iframe, but i want to display the content div only.

I honestly have no clue at all where to look...is this possible at all?
If it is possible what language do i use? php, jquery, javascript, xml?
Can someone help me out please?

Thnx in advance

Da warfish

10-24-2011, 01:01 PM
This will be blocked for any client side methods (such as Javascript) for security reasons. There are some difficult methods if you own both domains (basically by specifying permission), but they don't necessarily work in all cases.

PHP (and other server side methods) won't be blocked by this. So you could use include(), or other options, to use part of the other site in your page.

But whatever you do you'll need to configure everything to work, such as making one file for the item you want to share (the menu, for example) and including it into both pages (one on the same site and one on the other site). Splitting an element from inside a page is difficult and not efficient.

Also, for this sort of thing, one good option would be to use a database, and you can connect to a database from another server, so you would be able to share it that way.