Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    does a css- or javascript-file delay?

    Hello,
    I was wondering;
    what loads the fastest?
    When you put the css-code in the html-file
    or when you make an additional css-file?
    And what about javascript?
    Greetings and thank you for your time.

  • #2
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,960
    Thanks
    120
    Thanked 76 Times in 76 Posts
    the rules says to put ref to js file into head section. Often it shows that it is better to put it at the end of HTML.

    For firefox get yourself httpfox addon, and you will see what is downloaded when.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #3
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Technically when you put CSS inline, as there is no need for an additional HTTP request for the same amount of content.

    However, if you put the CSS in an external file, it is cached, meaning it doesn't need to be downloaded again. This results in lots of bandwidth and time savings in the long run.

    In reality, the difference is negligible, so save yourself the bytes and put it in an external file.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello jess_quna,
    That's not really a valid question. Load times for either one will depend more on how well they are written and what they are doing.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •