Jump to content


Photo

External CSS File & Scripts

LuckyDog Sports ProScore Invitational US of A Chopped

6 replies to this topic

#1 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,506 posts
  • Gender:Male
  • Location:Colorado

  • 2019 MFL: 38948
  • , 64543

Posted 08 July 2019 - 05:15 AM

Currently, I have my css code in HPM #1 as a Header Message which includes the following scripts:
 
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
 
<script src="//www.habman.com/mfl/apps/js/habmanJSON_common.js"></script> --> because I'm using a couple of habman's modules
 
Now if I want to either upload the css code or provide a direct link to an external css style file via Setup > Images and other URLs do I still have to have the above two scripts in a header message?
 
True?  Or is there another route? 
 
BTW - I didn't / couldn't find anything that specifically addressed this when I did a search of the forums and when I tried both avenues I had to have them as a Header Message - did I just answer the first part of my own question?   <_<  :D

ldsportslogoindex_32x32.png  LuckyDog Sports 

" Fantasy Fun For Football Fanatics "


#2 DA-G-GURU

DA-G-GURU

    Veteran

  • Members
  • PipPipPip
  • 1,160 posts
  • Gender:Male
  • Location:DAGrafixDesigns.com

Posted 08 July 2019 - 07:19 AM

You are a bit confused i think here, first a CSS file is NOT a SCRIPT
file....a script file is java, or jquery .... a css is a style sheet
that gives a page colors, framing, order, etc.

 

ALL
JS FILES.... (as far as i know ok).... are linked in the HPM as you have
them above, OR they are in the hpm hard coded between the tags
<script> CODE HERE </script>

 

ONE main css
file can be uploaded via the OTHER URL area, you can in that ONE MAIN
css file @import other css files if you like from this example.

@import url(https://fonts.google...ald:400,300,700);

 

OR

 

You can add css files to the HPM just like you did with the <script> but with the tag of this below......

<link rel="stylesheet" type="text/css" href="URLPATHTOCSSHERE">

 

Hope that helps.


Simply The Best in Grafix and CSS webdesign since 2005

www.dagrafixdesigns.com

---------------
Twitter @DA_Sticks

#3 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,506 posts
  • Gender:Male
  • Location:Colorado

  • 2019 MFL: 38948
  • , 64543

Posted 08 July 2019 - 07:33 AM

Thanks for the response Guru.

 

Don't think I'm confused, but I confused you.

 

In my HPM Header Message I have both the Scripts & CSS Code, i.e., 

 

<script> . . . . . <</script>

 

<style> . . . . . </style>

 

What I was asking is "do I have to have to load the two scripts as I described in my 1st post in a HPM Header Message even though I have an external CSS file or is there another way to do it?"

 

Clear as mud, right?   :)

 

O yea - is there an advantage to have an external CSS file other than loading it via a HPM or uploading it via MFL's interface?


ldsportslogoindex_32x32.png  LuckyDog Sports 

" Fantasy Fun For Football Fanatics "


#4 DA-G-GURU

DA-G-GURU

    Veteran

  • Members
  • PipPipPip
  • 1,160 posts
  • Gender:Male
  • Location:DAGrafixDesigns.com

Posted 08 July 2019 - 07:38 AM

You confuse me lol....never....always....huh? :blink:

 

Ok So the simple answer is YES you do....load those scripts in the HPM by the URL LINK or have the actual code between the tags (hard embed coded)...in the HPM


Simply The Best in Grafix and CSS webdesign since 2005

www.dagrafixdesigns.com

---------------
Twitter @DA_Sticks

#5 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,506 posts
  • Gender:Male
  • Location:Colorado

  • 2019 MFL: 38948
  • , 64543

Posted 08 July 2019 - 05:18 PM

Thanks for confirming what I assumed had to be.

 

So, is it better to load an external CSS File or just load it via an HPM?  Curious minds want to know.   :blink:  :wacko:


ldsportslogoindex_32x32.png  LuckyDog Sports 

" Fantasy Fun For Football Fanatics "


#6 DA-G-GURU

DA-G-GURU

    Veteran

  • Members
  • PipPipPip
  • 1,160 posts
  • Gender:Male
  • Location:DAGrafixDesigns.com

Posted 08 July 2019 - 05:49 PM

Hummm I do not know that answer... I always load the style sheet via the other URL.....but it might 50-50 depending on speed or who you listen to etc..It has always been good for me that way....no need to tinker man.


Simply The Best in Grafix and CSS webdesign since 2005

www.dagrafixdesigns.com

---------------
Twitter @DA_Sticks

#7 quickolas1

quickolas1

    Veteran

  • Members
  • PipPipPip
  • 953 posts
  • Gender:Male

Posted 22 July 2019 - 07:03 AM

The stylesheets (base, skin, your uploaded one) load before the HPMs so it's possible to get a flickering effect when your custom code loads lower in the priority order. (in HPM's)

 

CSS that applies to every page should be in the file/upload method.

The custom scoreboard CSS (and scripts for it) is in my custom scoreboard HPM as an example of code that I don't need/want loading on every page to maximize speed.

 

If you have scripts running on every page (in Header or Footer) that only apply to one single page (e.g. custom Scoreboard) that's a bit more significant as far as inefficiency especially if the script is bloated or cycles through commands repeatedly or has a bad line of code. Cycling scripts are a main cause of slow home pages where people try to stick every module/HPM they can onto their home page (because the top menu bar sucks so badly that they have to overcompensate by putting everything on the home page.

 

...AND from an organizational angle, add the horizontal "menu." and ANOTHER line of links. and ANOTHER line of links with icons... so much bloat with four top navigation areas at the top of a page is a basic design no-no as far as user experience.)

 

If someone is starting at the beginning to play with CSS, read up on flexbox. Of course myfantasyleague will probably never get to it.





Reply to this topic



  



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users