Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Loading web site within another website

Loading web site within another website

Scheduled Pinned Locked Moved Web Development
phpjavascripthtmlquestion
10 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    weinerschizel
    wrote on last edited by
    #1

    I would like to have header across the top of my page with links for my website. Then when some links are clicked it would actually load another website within a particular div of the current website. Is this possible? I'm working with wordpress so it's mainly PHP, javascript, and HTML. Specifically I want to display all properties for sale in my area. The properties are maintained on a separate webpage. I do not want to loose the visitor when they go to the separate website... but rather keep my header up so they can easily click back to my website as needed. That's basically what I'm trying to do in a nutshell.

    N Richard DeemingR Z 3 Replies Last reply
    0
    • W weinerschizel

      I would like to have header across the top of my page with links for my website. Then when some links are clicked it would actually load another website within a particular div of the current website. Is this possible? I'm working with wordpress so it's mainly PHP, javascript, and HTML. Specifically I want to display all properties for sale in my area. The properties are maintained on a separate webpage. I do not want to loose the visitor when they go to the separate website... but rather keep my header up so they can easily click back to my website as needed. That's basically what I'm trying to do in a nutshell.

      N Offline
      N Offline
      n podbielski
      wrote on last edited by
      #2

      You can use

      <iframe>

      HTML tag and change it's src attribute

      </pre>by JS code as click event handler.
      <pre lang="Javascript">
      somelink.onclick =function(event){
      iframe.src = event.target.href;
      event.preventDefault();
      }
      </pre>
      <div class="signature">No more Mister Nice Guy... >: |</div></x-turndown>

      W 1 Reply Last reply
      0
      • W weinerschizel

        I would like to have header across the top of my page with links for my website. Then when some links are clicked it would actually load another website within a particular div of the current website. Is this possible? I'm working with wordpress so it's mainly PHP, javascript, and HTML. Specifically I want to display all properties for sale in my area. The properties are maintained on a separate webpage. I do not want to loose the visitor when they go to the separate website... but rather keep my header up so they can easily click back to my website as needed. That's basically what I'm trying to do in a nutshell.

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        If you don't have permission to do this, most website owners will object. They'll either add script to break out of the frame, add headers to prevent their site being loaded in your frame, or possibly even resort to legal action. Somebody tried to do this to CodeProject a few weeks back[^]; the hamsters were not amused!


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        W 1 Reply Last reply
        0
        • Richard DeemingR Richard Deeming

          If you don't have permission to do this, most website owners will object. They'll either add script to break out of the frame, add headers to prevent their site being loaded in your frame, or possibly even resort to legal action. Somebody tried to do this to CodeProject a few weeks back[^]; the hamsters were not amused!


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          W Offline
          W Offline
          weinerschizel
          wrote on last edited by
          #4

          That sucks.

          Richard DeemingR 1 Reply Last reply
          0
          • W weinerschizel

            That sucks.

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            I think it's a perfectly reasonable response. If you'd spent time and effort making a really useful site, would you be happy for someone else to display your site surrounded by their branding and adverts?


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            1 Reply Last reply
            0
            • N n podbielski

              You can use

              <iframe>

              HTML tag and change it's src attribute

              </pre>by JS code as click event handler.
              <pre lang="Javascript">
              somelink.onclick =function(event){
              iframe.src = event.target.href;
              event.preventDefault();
              }
              </pre>
              <div class="signature">No more Mister Nice Guy... >: |</div></x-turndown>

              W Offline
              W Offline
              weinerschizel
              wrote on last edited by
              #6

              Sweeeeeeeeeeeeeeeeeeeeeeeeeeeeeet worked like a champ :) I created a new page template in wordpress and put the iframe tag for the body of the page. Here's a link to my test http://www.keystoaz.com/test/... I embedded one of my websites in another one of my websites. I'm curious though... Is there some trick to get the iframe to resize the page so it doesn't nest a scroll bar like that? Thanks!!!

              N 1 Reply Last reply
              0
              • W weinerschizel

                Sweeeeeeeeeeeeeeeeeeeeeeeeeeeeeet worked like a champ :) I created a new page template in wordpress and put the iframe tag for the body of the page. Here's a link to my test http://www.keystoaz.com/test/... I embedded one of my websites in another one of my websites. I'm curious though... Is there some trick to get the iframe to resize the page so it doesn't nest a scroll bar like that? Thanks!!!

                N Offline
                N Offline
                n podbielski
                wrote on last edited by
                #7

                weinerschizel wrote:

                I'm curious though... Is there some trick to get the iframe to resize the page so it doesn't nest a scroll bar like that?

                What do you mean? I frame has size allowed by page layout. If you give more space to iframe or page within iframe will be less space demanding scroll will disappear. Think of iframe like about browser window: window is to small for page scroll will appear to let you see all the content.

                No more Mister Nice Guy... >: |

                W 1 Reply Last reply
                0
                • N n podbielski

                  weinerschizel wrote:

                  I'm curious though... Is there some trick to get the iframe to resize the page so it doesn't nest a scroll bar like that?

                  What do you mean? I frame has size allowed by page layout. If you give more space to iframe or page within iframe will be less space demanding scroll will disappear. Think of iframe like about browser window: window is to small for page scroll will appear to let you see all the content.

                  No more Mister Nice Guy... >: |

                  W Offline
                  W Offline
                  weinerschizel
                  wrote on last edited by
                  #8

                  Yeah that's what I figured... Just thought I would see if there was some sort of script / hack that could re-size the iframe though. Googling doesn't come up with too much either. The page webpage I plan on embedding is a fixed height anyways so it probably won't even matter anyways. (I have to pay $300 / year for the ability to embed it).

                  N 1 Reply Last reply
                  0
                  • W weinerschizel

                    Yeah that's what I figured... Just thought I would see if there was some sort of script / hack that could re-size the iframe though. Googling doesn't come up with too much either. The page webpage I plan on embedding is a fixed height anyways so it probably won't even matter anyways. (I have to pay $300 / year for the ability to embed it).

                    N Offline
                    N Offline
                    n podbielski
                    wrote on last edited by
                    #9

                    It is possible. Try setting style of iframe

                    $('iframe').css({
                    'position':'absolute',
                    'top':'0px',
                    'left':'0px',
                    'height':'100%',
                    'width':'100%'
                    });

                    I am not sure about syntax. It's be a while since I manipulated styles with jQuery, so better check it with documentation. But this should work. Basicly it's setting left-top corner of frame to left-top corner of window, and force iframe to take all available window space. I did not try this with iframe but I guess this should work like with any other html element.

                    No more Mister Nice Guy... >: |

                    1 Reply Last reply
                    0
                    • W weinerschizel

                      I would like to have header across the top of my page with links for my website. Then when some links are clicked it would actually load another website within a particular div of the current website. Is this possible? I'm working with wordpress so it's mainly PHP, javascript, and HTML. Specifically I want to display all properties for sale in my area. The properties are maintained on a separate webpage. I do not want to loose the visitor when they go to the separate website... but rather keep my header up so they can easily click back to my website as needed. That's basically what I'm trying to do in a nutshell.

                      Z Offline
                      Z Offline
                      Zamshed Farhan
                      wrote on last edited by
                      #10

                      Yes, you may use iframe and within it load an url.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups