SitePoint Sponsor

User Tag List

Results 1 to 22 of 22
  1. #1
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question XHTML Strict 1.0 alternative to iframe ?

    The title says it all, is there an alternative to iframes that validates XHTML Strict 1.0 ?

    I need to put a little piece of HTML from another server to my site.

    Thanks

  2. #2
    SitePoint Member
    Join Date
    Dec 2006
    Location
    Germany, but living in Denmark
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you take xhtml 1.0 transitional?

    [offtopic]Denmark is cool, actually im living their...[\offtopic]

    coda

  3. #3
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do everything strict !

    So, itīs not possible ?

  4. #4
    SitePoint Guru Rob_D's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An alternative is to use server side includes.
    It has yet to be proven that intelligence has any survival value.
    Arthur C. Clarke

  5. #5
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, does server side includes work for URLs outside my own domain ?

  6. #6
    SitePoint Guru Rob_D's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    According to this you can but I guess it depends on the set up on the server you are pulling the code from. Perhaps, someone with more knowledge can answer this?
    It has yet to be proven that intelligence has any survival value.
    Arthur C. Clarke

  7. #7
    SitePoint Member
    Join Date
    Dec 2006
    Location
    Germany, but living in Denmark
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That should go with server side includes. Then make a div element with overflow and you have an alternative...

    just try it.

    coda

  8. #8
    SitePoint Guru Rob_D's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "PHP include directives can also point at files on any web site using a full URL:

    <?php include("http://www.othersite.com/filename.html"); ?>

    Of course, you must not steal content from another web site without the express written permission of the owners. To do so is a copyright violation and may lead to legal action against you."

    I got the above from here
    It has yet to be proven that intelligence has any survival value.
    Arthur C. Clarke

  9. #9
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The other server is also my site.

    I will try the php include - thanks

  10. #10
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by wii View Post
    I do everything strict !

    So, itīs not possible ?
    If dropping to Transitional is the only/quickest way to do something, then why not?

    You could also try this, but I'm not guaranteeing it will work across all browsers:
    HTML Code:
    <object type="text/html" data="http://someurl.com/htmlpage"
    width="250" height="500">
    <param name="src" value="http://someurl.com/htmlpage" />
    Alternate content for browsers without object support.
    </object>

  11. #11
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I will try that too.

  12. #12
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As Vinnie said, object is what should be used instead of iframe. Unfortunately, some rather popular browsers have poor support for object.

  13. #13
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure if you've seen this already, but Aleksander Vacic described an alternative method to iframes on his site

  14. #14
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks interesting, I will play with that also.

  15. #15
    SitePoint Member kasted's Avatar
    Join Date
    Feb 2006
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also use:

    HTML Code:
    div.myframe { width: 400px; height: 500px; overflow: scroll; }
    HTML Code:
    <div class="myframe">You can put some text here, but not put an external HTML file, But you could use php includes.</div>

  16. #16
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Object will not work in IE 6.0 for external domains. If you have to do it, you need to change the security settings of your browser. Even for IFRAMES accessing cookies will fail due to security settings in IE 6.0.

    Is there any way to overcome? Is there any alternate method other than IFRAME and Object? Any body please help.

  17. #17
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I decided on server side includes - faster and better.

  18. #18
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use this

    <object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" type="text/html" data="xpto.html" width="300" height="300"></object>

  19. #19
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey all,

    I just wanted to post this is the case that someone may need it.

    gronkyco.com/blog-posts/xhtml-strict-iframes-using-jquery/

    In that post I describe how to use jQuery to create xHTML-Strict iFrames. I looked for ages for a solution and finaly just decided to make my own.

    hope it helps!

    Cheers

  20. #20
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by satchownz View Post
    Hey all,

    I just wanted to post this is the case that someone may need it.

    gronkyco.com/blog-posts/xhtml-strict-iframes-using-jquery/

    In that post I describe how to use jQuery to create xHTML-Strict iFrames. I looked for ages for a solution and finaly just decided to make my own.

    hope it helps!

    Cheers
    That is just fooling the validator by changing the HTML to be invalid after the page loads.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  21. #21
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a patch for sure, but serves a much more compatible, search friendly solution to the browser for use in the occasions where iFrame are unavoidable.

    One big reason I did this was because I'm an amazon affiliate and for some reason, they insist developers use iFrames for most of their links.

    I run the amazon program on a number of sites and have seen improvements since using this type of system.

    Once there is a "proper" replacement for iFramed content that is browser friendly and supported, I'll certainly switch over.

  22. #22
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If an IFRAME is 'unavoidable', then use a Transitional doctype and an IFRAME. There's no point in pretending to use a Strict doctype and then sneak the deprecated element in using JavaScript. If you're going to use old-school technology, be upfront and honest about it.
    Birnam wood is come to Dunsinane


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
  •