treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Showing external HTML pages without iframe/target="iframe"

  • I don't like using iframes to show external HTML pages because Firefox and IE don't display the width and height properly inside the iframe. Is there an alternative way to show external HTML pages on the very same page? i want external HTML pages to show inside the white area of this websiteWebsite.

  • External sites or internal site pages?

  • @AndyHowells internal site pages

  • And are these pages filled with the content to load within that area on an action, like clicking the nav for example?

  • Yes. They are simple HTML pages only with the content i want to display. And they will appear when the nav buttons are clicked.

  • Okay, your best bet then is AJAX. Basically you can use JQuery to call the content based on which nav item the user clicks and then load it in the content container.

    Details all about AJAX here - http://api.jquery.com/jQuery.ajax/

    Note that this method is not necessary very good for SEO purposes as you'll only have the single page and none of the external content will be indexable as it's not in the source until called in.

    Is there a reason you're not simply using multiple pages?

  • @AndyHowells Thanks for all the help. I'm simply doing it this way because i think it looks good and its really easy to use without having to scroll. But i think your right about the SEO thing. I want my website to be easily found on Google. What do you suggest i do?

  • Use proper paging, so have everything seperated into different pages.

    If you want some sort of transition you could use CSS transitions to load the content area slowly.

  • That's basically what it is. The pages will be located in different directories andon the same domain just like any other website. The only difference is that those pages will show inside the iframe. I really don't understand what the huge difference is.

  • Ooops. I confused this discussion with another.