Results 1 to 2 of 2

Thread: hyperlink to external domain div

  1. #1
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default hyperlink to external domain div

    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

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •