Results 1 to 8 of 8

Thread: load a full webpage into div

  1. #1
    Join Date
    Nov 2011
    Posts
    74
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default load a full webpage into div

    i have a webpage that i want to be able to show external websites in the div. i have looked but can find what i need. i can see url in a div but i need to be able for the full webpage to be shown in the div not just part of the URL

    thanks in advance

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

  3. #3
    Join Date
    Nov 2011
    Posts
    74
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by molendijk View Post
    There are many ways to do it. See this, for example.
    this link provide does not load a full webpage into a div. there is a button.



    <div id="topBar"> <a href ="#" onclick="load_home()"> HOME </a> </div>
    <div id ="content"> </div>
    <script>
    function load_home(){
    document.getElementById("content").innerHTML='<object type="type/html" data="http://www.google.com" ></object>';
    }
    </script>
    </div>

  4. #4
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    That's because certain sites (Google, Facebook ...) can't be embedded in an iframe or object. Replace data="http://www.google.com" with data="http://www.dynamicdrive.com" and you'll see what I mean.
    Btw, type="type/html" should be type="text/html".

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It's a little unclear what you want. It sounds like you want your page to look and act like it's the other page. That's often a violation of the other site's copyright and/or its terms of service. Because of that, other sites will sometimes even have code to prevent it. But if you have permission to do it and the other site permits it from a code point of view, it's possible. In fact, if the other site explicitly sets an origin header that allows it, you can import its content via AJAX. Few sites do that though unless they want you to do what you are asking for, and it must be set on the server side.

    See also:

    http://www.dynamicdrive.com/forums/s...192#post321192
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Jonnyfreak are you looking for something like this? If so, follow the instructions given on my demo site.

  7. #7
    Join Date
    Nov 2011
    Posts
    74
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    It's a little unclear what you want. It sounds like you want your page to look and act like it's the other page. That's often a violation of the other site's copyright and/or its terms of service. Because of that, other sites will sometimes even have code to prevent it. But if you have permission to do it and the other site permits it from a code point of view, it's possible. In fact, if the other site explicitly sets an origin header that allows it, you can import its content via AJAX. Few sites do that though unless they want you to do what you are asking for, and it must be set on the server side.

    See also:

    http://www.dynamicdrive.com/forums/s...192#post321192

    sorry i should have explained it more. The divs are only 300px by 300px and displaying thumbnails of webpages that will have links the the said webpages

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Oh, you can't really do that with just javascript I don't think. There are server side programs for that (none free that are any good I'm aware of, though I haven't looked into it for some time*), or you could just make your own thumbnail images and link them in the normal manner.


    * A while back I experimented with one that used PHP's GD image library and a virtual incidence of the IE browser (version 8 back then, so that wouldn't work any longer, not sure if any browser today would be applicable), to generate a "real time" (that was the issue, took too long) thumbnail.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Load webpage in to div onload
    By Nigejk in forum JavaScript
    Replies: 2
    Last Post: 02-14-2011, 04:44 PM
  2. Animated Collapse - errors before full page load
    By a575606 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 04-21-2009, 02:12 AM
  3. Full Screen Load movie problems
    By punstc in forum Flash
    Replies: 1
    Last Post: 12-09-2007, 07:58 AM
  4. Code / Script to Load XML file within webpage
    By evandowen in forum Looking for such a script or service
    Replies: 2
    Last Post: 12-22-2006, 10:11 PM
  5. go to full screen on load
    By jpozzi in forum JavaScript
    Replies: 1
    Last Post: 03-24-2005, 11:44 AM

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
  •