Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 07-31-2012 10:35:45

sbhkma
Member
Registered: 05-17-2006
Posts: 448

Changing order of js and css in header

Where do I edit the information so that the css comes BEFORE the js in the header?

Code:

<script type="text/javascript" src="media/jquery/jquery.min.js"></script>
<script type="text/javascript" src="media/jquery/jquery.easing.min.js"></script>
<script type="text/javascript" src="media/jquery/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="media/fancybox/jquery.fancybox.min.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="media/fancybox/jquery.fancybox.css" />
<style type="text/css" media="all">#fancybox-close {display: block;}</style>

should be

Code:

<link rel="stylesheet" type="text/css" media="all" href="media/fancybox/jquery.fancybox.css" />
<style type="text/css" media="all">#fancybox-close {display: block;}</style>
<script type="text/javascript" src="media/jquery/jquery.min.js"></script>
<script type="text/javascript" src="media/jquery/jquery.easing.min.js"></script>
<script type="text/javascript" src="media/jquery/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="media/fancybox/jquery.fancybox.min.js"></script>

Offline

 

#2 08-01-2012 02:48:45

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Changing order of js and css in header

Why do you believe it needs to be changed? It will make no difference in how the page is rendered.

Offline

 

#3 08-01-2012 08:33:19

sbhkma
Member
Registered: 05-17-2006
Posts: 448

Re: Changing order of js and css in header

Because a client is fixated on Yslow and THAT is telling him it needs to be done.

Offline

 

#4 08-01-2012 10:56:52

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Changing order of js and css in header

If you must, it's in your skin.php script.

John

Offline

 

#5 09-12-2012 11:22:08

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 936

Re: Changing order of js and css in header

This is done for efficiency - aka page load time for SEO.
If the css is loaded BEFORE the js, the js then has the css to work with while the page continues to load.

Of course, the css that the js uses should load first, but it is good practice to load all css in case someday a js uses another css.

Last edited by Blitzen (09-12-2012 11:22:52)

Offline

 

Board footer