Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: alternative to target aspect of frames/iframes

  1. #1
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    97
    Thanks
    31
    Thanked 2 Times in 2 Posts

    Default alternative to target aspect of frames/iframes

    I've looked around for some idea for this, but now decided to post.

    I had my old webpage in frames, which now are pretty much defunct. Some people suggest iframes, but they also seem be on their way out as I understand XHTML won't support them in the future.

    Fine.

    Is there a simple way to do what frames does:

    SPECIFICALLY if I have a page with little images, to click on the little images (like a menu of images) and have a bigger image (or whatever content) appear in a specific place on the page. In frames this meant setting up one frame as the target for where content would be displayed.

    Is this only possible in really complicated ways? SSI, for example, partly seems to do what frames did, by combining pages. But I don't know if you can set things up to do what I mean above.

    Thanks.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Some people suggest iframes, but they also seem be on their way out as I understand XHTML won't support them in the future.
    XHTML (and HTML for that matter) doesn't support them now, only the outdated Transitional DOCTYPEs which were meant to ease webmasters' transition from HTML3, and so duplicate some of HTML3's features. In other words, <iframe>s have been obsolete since HTML4 was completed in 1998.

    You'd want to use Javascript, possibly with the XMLHttpRequest object.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    97
    Thanks
    31
    Thanked 2 Times in 2 Posts

    Default

    Do you mean something similar to what this person was asking about:
    http://www.dynamicdrive.com/forums/s...ad.php?t=28606

    Is there someplace you can recommend for me to look at to learn?
    Javascript is not so easy for me, though I've figured out some of it before.

    But also, I heard it is not too good to use Javascript, like if people have it turned off, etc. Maybe it also complicates things too much?

    There is no other way, huh?

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You just have to construct your links properly. For example, you might write:
    Code:
    <a href="foo.html" onclick="loadIntoElement(this.href + '.json'); return false;">
    ... where foo.html.json is a page containing foo.html's markup in JsonML format, and loadIntoElement is a function capable of taking an URL and rendering the resulting JsonML into an element in the DOM. That way, anyone who doesn't have Javascript will simply get the static page.

    Of course, then you're maintaining two copies of each page. It's easier to use a server-side script that parses the JsonML into HTML when needed, or one that parses both out of XML (perhaps XHTML).
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    97
    Thanks
    31
    Thanked 2 Times in 2 Posts

    Default

    OK. I am not very familiar with what you are saying, but I'll look into it. Thanks!

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

    Default

    As long as a DOM-method like
    Code:
    var Ifr = document.createElement('iframe');
    Ifr.setAttribute("src","somefile.html"), etc.
    is supported. I wouldn't worry too much about the iframe being deprecated.

    Arie Molendijk.

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Arie would have us descend into digital anarchy like in the days of the browser wars.

    As usual, there are good reasons for it being deprecated. It causes a lot of accessibility problems.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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

    Default

    Speaking of the dark Middle Ages, what's the difference, then, between my previous message (creating an iframe) and directly using an iframe on a page, like in this recent thread?
    Anyway, I wouldn't like to go back this far.

    Arie.

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Speaking of the dark Middle Ages, what's the difference, then, between my previous message (creating an iframe) and directly using an iframe on a page, like in this recent thread?
    Yours requires JS, and the validator can't check JS so will say it's valid (even though it isn't). Bear in mind that the validator is neither authoritative nor exhaustive.
    Anyway, I wouldn't like to go back this far.
    Haha, yes, those fire catapults look painful!
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    97
    Thanks
    31
    Thanked 2 Times in 2 Posts

    Default

    You know, I don't understand why the people who write these codes don't understand how nice it is to have a scrollable menu that puts pictures in the same page. Especially for viewing pictures, but for much more. So you have the menu and the final bigger content right there.

    It seems like something so basic that many people would instinctively want.

    It is shameful that we have to go around it in complicated ways. So, there were problems with frames. But taking them out altogether without a better alternative is pretty bad.

    This is what turns designers to use flash, which I can't stand...

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
  •