SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can anyone cure this code from moving around please ?

    If you look on the page below, the menu on the right appears straight away

    http://130609.com/without-stats-code/

    If you look on the page below, in the first few seconds, the menu on the right doesn't appear for a few seconds

    http://130609.com/with-stats-code/

    The aim is to have the same stats code, but, with the menu on the right appearing straight away.

    I've been trying to solve this for a few months, communicating with experts, but no-one seems to be able to solve it ;-(

    Any help on this is very much appreciated.

    Dez.

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,589
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Just a guess-try putting width/height attributse on the images in the stat codes because with tables if the browser doesn't know how big the image is at the time of the HTML it will have to wait for the CSs or the image to be loaded.

    Alternatively you could give the table this- "table-layout:fixed;"

    Should patch it up (My internet is too fast to detect that)
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  3. #3
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    Just a guess-try putting width/height attributse on the images in the stat codes because with tables if the browser doesn't know how big the image is at the time of the HTML it will have to wait for the CSs or the image to be loaded.

    Alternatively you could give the table this- "table-layout:fixed;"

    Should patch it up (My internet is too fast to detect that)
    Many thanks for the help Ryan, I'm so desperate to get this solved.

    As you can from the page with stats code, (http://130609.com/with-stats-code/) I gave the image the measurements, but still doesn't show the right menu straight away on page load ;-(

    I'll now try your 2nd option, but how do you mean "table-layout:fixed;" - does that go in the css ?

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,589
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Yes it should go on the table.
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  5. #5
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Have now done that as well, but still no luck ;-( If you, or anyone else has any other ideas, it would be much appreciated.

    Here's the code :

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd"> 
    <html lang="en">
    <head>
    <title>Test page for the statscode</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="/styles.css">
    </head>
    <body>
    <table>
    <tr>
    <td>
    <h3>Test page</h3>
    </td>
    </tr>
    </table>
    <table>
    <tr> <td>   
    <?php include($_SERVER['DOCUMENT_ROOT'].'/_a_includes/left.php'); ?>
    </td>
    <td class="maintextcell">
    <p>As you can see, when refreshing this page, the centered text clearly moves to 
    the right first, before going to the center.
    <p>Sample text - Sample text - Sample text - Sample text - Sample text - Sample 
    text - Sample text - Sample text - Sample text - Sample text - Sample text - 
    Sample text - Sample text - Sample text - Sample text - Sample text - Sample 
    text - Sample text - Sample text - Sample text - Sample text - Sample text - 
    Sample text - Sample text - Sample text -
    <p>Sample text - Sample text - Sample text - Sample text - Sample text - Sample 
    text - Sample text - Sample text - Sample text - Sample text - Sample text - 
    Sample text - Sample text - Sample text - Sample text - Sample text - Sample 
    text - Sample text - Sample text - Sample text - Sample text - Sample text - 
    Sample text - Sample text -
    <p>
    <p> 
    The counter is below :
    <p>
    <p>
    <!-- Start of StatCounter Code -->
    <script type="text/javascript">
    sc_project=2408508; 
    sc_invisible=0; 
    sc_partition=22; 
    sc_security="92e173ba"; 
    sc_text=2; 
    </script>
    <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script>
    <noscript>
    <div class="statcounter"><a title="web counter" href="http://www.statcounter.com/" target="_blank">
    <img width="60px" height="14px" class="statcounter" src="http://c23.statcounter.com/2408508/0/92e173ba/0/" alt="web counter"></a>
    </div></noscript>
    <!-- End of StatCounter Code -->
    </td>
    <td> 
    <?php include($_SERVER['DOCUMENT_ROOT'].'/_a_includes/right.php'); ?>
    </td>
    </tr>
    </table>
    </body>
    </html>

    Here's the css :

    Code:
    a:link, a:visited, a:active {
    color:#000080;
    text-decoration:none;
    border-bottom:1px dashed blue;
    }
    a:hover {
    color:#360; 
    text-decoration:none;
    border-bottom:2px dotted blue;
    }
    body, html {
    color:#006;
    background:#006;
    text-align:center;
    font-weight:normal;
    font-family:verdana, arial, helvetica, sans-serif;
    border:0;
    padding:0;
    }
    body {
    margin:12px 4px 7px 4px;
    }
    h1 {
    font-size:23px;
    text-align:center;
    margin-top:16px; 
    margin-bottom:4px; 
    }
    h2 {
    font-size:17px;
    margin-top:12px; 
    margin-bottom:0; 
    text-align:center; 
    line-height:125&#37;;
    }
    h3 {
    font-size:15px; 
    margin-bottom:0; 
    margin-top:6px; 
    text-align:center; 
    font-weight:bold;
    line-height:120%;
    }
    h4 {
    font-size:13px; 
    margin-bottom:-2px; 
    margin-top:8px; 
    text-align:center; 
    }
    .maintextcell {
    width:520px;
    margin-top:0;
    margin-bottom:3px;
    padding:1px 5px 5px 5px;
    text-align:left;
    }
    p {
    font-size:14px;
    font-weight:normal;
    line-height:122%;
    margin-top:0;
    margin-bottom:5px;
    padding:1px 5px 6px 5px;
    text-align:left;
    }
    table {
    table-layout:fixed;
    width:760px;
    margin-left:auto;
    margin-right:auto;
    background:#fff; 
    border:0;
    padding:0;
    }
    td {
    vertical-align:top;
    }
    ul {
    margin-left:25px;
    }
    and the original question :

    If you look on the page below, the menu on the right appears straight away

    http://130609.com/without-stats-code/

    If you look on the page below, the menu on the right doesn't appear for a few seconds ? ?

    http://130609.com/with-stats-code/

    The aim is to have the same stats code, but, with the menu on the right appearing straight away.

    I've been trying to solve this for a few months, communicating with experts, but no-one seems to be able to solve it ;-(

    Any help on this is very much appreciated.

    Dez.

  6. #6
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Anyone ?

  7. #7
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Well, I can't figure out why you've stuffed your scripts in the middle of your code. Obviously it's taking browsers some time to load that junk. Usually you see these codes at the bottom of an HTML document, right before the closing </body> and </html> tags, for specifically this reason: the browser goes in order of the code. Since the whole page should be loaded before the script is run, people put the scripts after the page code.

    I assume you have some specific reason for putting the script in the middle of the page? If not, does moving it to the bottom help?

    Actually for the amount of content it will look like you have, the whole things might (MIGHT) load faster if it weren't in a table (though table-layout: fixed can really speed things up).

    I should note, for me the first half of the menu appeared instantaneously but the second half took a moment (a half-second or so). However I don't let my browser run scripts (your server logs will show me but your tracking software won't see me except when I chose to accept image filetypes from your page (that's their poor-man's way of getting around the JS-less, so actually still not as accurate as your real server stats)), so I'm not getting any script-running delay, only my browser seeing that it's there and hiccuping until it gets back to some HTML.

    *edit I've tried accessing your page several times with everything turned off, with only HTML loading, and I get the hiccup. Since I'm not executing the script, nor loading the image, it should be ignored practically like a comment. Only thing I can think of is try again with scripts at the bottom of the page.

  8. #8
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Thanks for the input. I did try to find some 'junk' code, but couldn't seem to find any. Anyway, yep, moving the stats code lower down did help, but that code is needed higher up the page where it is. (The page, as you know, is only a test page - the actual destination page warrants the precise location of the stats, and the table layout stays the same).

    There's a very good chance that this may be getting solved this on another forum, but in the meantime, if you have any other possible solutions, please let us know.

  9. #9
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I did try to find some 'junk' code, but couldn't seem to find any. Anyway, yep, moving the stats code lower down did help, but that code is needed higher up the page where it is.
    By junk I did mean the scripts, not HTML. I have a bias against tracking scripts : ) You are free to ignore it.

    So we know it's the scripts causing the problem, because the problem did go away when you moved them down.

    May I ask why they need to by higher in the page? It looked like regular tracking code, who only notes that someone loaded the page. There's always some small delay when a browser has to stop what it does and see if it needs to run some script or go over something that isn't HTML, that's normal.
    (there are surely scripts who only note the loading of parts of the page, allowing you to have the script in a better spot on the page)

    In any case, do you think most people would find a small hiccup a problem? Every time I load sitepoint.com, I get a bunch of text and a list of scripts for a moment, before the page actually loads (seems to be a known Firefox problem) and anyone without a blazingly fast internet connection is used to pages taking a moment to load. If this page is going to have a lot of stuff on it anyway, it'll take everyone a moment to load, and a twitch before the right side is loaded won't surprise anyone.

  10. #10
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Here's something I ran into while looking for something else:
    http://www.datalandsoftware.com/blog...sed-analytics/

  11. #11
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Quote Originally Posted by Stomme poes View Post
    By junk I did mean the scripts, not HTML. I have a bias against tracking scripts : ) You are free to ignore it.

    I do (and I still couldn't find any junk)

    So we know it's the scripts causing the problem, because the problem did go away when you moved them down.

    May I ask why they need to by higher in the page?

    Because if it was outside of the body tags, the viewers wouldn't be able to . . . . view it.

    It looked like regular tracking code, who only notes that someone loaded the page. There's always some small delay when a browser has to stop what it does and see if it needs to run some script or go over something that isn't HTML, that's normal.
    (there are surely scripts who only note the loading of parts of the page, allowing you to have the script in a better spot on the page)

    In any case, do you think most people would find a small hiccup a problem? Every time I load sitepoint.com, I get a bunch of text and a list of scripts for a moment, before the page actually loads (seems to be a known Firefox problem) and anyone without a blazingly fast internet connection is used to pages taking a moment to load. If this page is going to have a lot of stuff on it anyway, it'll take everyone a moment to load, and a twitch before the right side is loaded won't surprise anyone.
    Yep, and am now trying to get rid of that 'twitch'.


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
  •