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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -