javascript - Absolute vs relative URL for CSS and JS -


need know if approach include css or js better -

<link href="http://www.mysite.com/css/style.css" rel="stylesheet" type="text/css">  or  <link href="./style.css" rel="stylesheet" type="text/css">  

someone told me if use absolute url (including http://www.mysite.com) css or js downloaded server on every page load.

please me understand this.

the short answer is: doesn't matter. use whichever style prefer, try consistent.

the long answer is:

people have been asking kind of question since css became thing. there kinds of answers out there argue 1 way or other, citing performance implications or maintainability.

none of matters because:

  • browsers efficient performance difference moot.
  • worrying optimizing inclusion paths distraction, , you're better off writing code.

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -