SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Moving from frames

    I've been using frames in my desings for very long now. I've pushed it as far as I can. I use it to hold the top-banner, and the left side menu, and now also to get a fixed size for my pages. I know... some people hate frames, but before CSS, I didn't know what else to do, exept using tables, and that wasn't what I wanted.

    I have a little thing about completely reloading the page when a link is clicked. I don't want that. I like the way you can click a link and get it to load in a frame. It makes the site faster, because I have the images and designs in the static frames, and the content doesn't have a background image, just a matching colour.

    I'm new to CSS. I know there is something called box, which is similar to a frame (I think). Can I load the content in a box (or something else) and get the same effect as with frames? It would help a lot.
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...

  2. #2
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, if you really don't want the whole page to reload each time you still need to use frames. I know loads of people have probably said this already but it just isn't worth it - frames make bookmarking / linking to pages on your site virtually impossible, make your site behave strangely when people open links in new windows, break the back button on your browser and are generally an accessibility and usability nightmare.

    The small speed improvement really isn't worth putting up with all the disadvantages.

  3. #3
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think your question is more about javascript than css
    Anyway, what you can do is create <div> tags and use javascript to update the innerHTML of the <div>s
    You can call asp/php pages with javascript, using xmlhttp (IE) or xmlhttprequest (Mozilla) objects

  4. #4
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Skunk
    ...frames make bookmarking / linking to pages on your site virtually impossible...
    Not if you provide a link "Get url for this page"
    (http://someserver/default.asp?url=somepage.asp)
    Then people can bookmark / link to a page in the frameset

  5. #5
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Skunk... I KNOW people don't like frames, thats why I'm trying to find an alternative. I also know there are a lot of tricks that can make framed sites work properly when bookmarking and browsing. What do you mean, frames making linking to the site virtually impossible? I can always provide a "copy and paste" text for links, so people who don't know anything about html can link to my site as well. If you (not you Skunk, people in general) don't know how to do that, well... read the tutorial first. I won't provide support for FrontPage though, never liked it, won't use it.

    Jofa... if java is the way, can you point me to a site or a thread with some info about it? I'm not interested in asp or php at the moment, so just basic html and java will be fine.

    I know I'm picky in my design, but I don't want the background (topbanner, menu-background) reload when a link is clicked. I just hate that white window staring back at you. It has nothing to do with "people don't realy care about that". I know how I want it, and it is my site. When I design for others, they tell me what they want, and I do it. The more tools I have the better sites I can design.
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...

  6. #6
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I have a solution for you

    Use CSS to mimic frames (use the overflow:scroll attribute - http://www.webreference.com/html/tutorial24/7.html)

    For the common navigation sections, save needless reloading by taking your HTML and converting it to JavaScript, then put that in a .js file (use http://www30.brinkster.com/docright/doc-right.asp to quickly do the HTML > JS conversion)

    You still have a way of easily amending navigation site-wide, and every reload of the page only means pulling cached JS content off the hard drive.
    Build Your Own Web Site the Right Way!
    A beginners' HTML/CSS book with web standards at its heart
    The Ultimate HTML Reference
    A complete reference, in glorious hardback

  7. #7
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by reptilianfeline
    Jofa... if java is the way, can you point me to a site or a thread with some info about it? I'm not interested in asp or php at the moment, so just basic html and java will be fine.
    javascript, not java!
    Here's a simple example:
    Code:
    <html>
      <head>
        <script language="javascript">
          function updateDiv(div, page)
          {
            var http = new ActiveXObject("Msxml2.XMLHTTP");
            http.open("GET", page, false);
            http.onreadystatechange = function()
            {
              if(http.readyState == 4)
              {
                div.innerHTML = http.responseText;
              }
            }
            http.setRequestHeader("Accept", "text/html");
            http.send(null);
          }
        </script>
      </head>
      <body>
        <a href="javascript:updateDiv(div1, 'somepage.htm');">Get somepage.htm</a>
        <div id="div1" style="width:300px;height:200px;overflow:scroll;border: #cccccc 3px inset;">
          This is an empty div
        </div>
      </body>
    </html>
    To do: add code to handle Mozilla/Netscape browsers, and use XMLHttpRequest in those cases

  8. #8
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found a great tutorial about doing what I want, the thing is... it uses layers and you can't access the separate pages. What do search engines think about that? And what about bookmarking the pages?
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...


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
  •