Re: including CSS & JS on only pages that need that CSS & JS [message #175587 is a reply to message #175579] |
Mon, 10 October 2011 12:30 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 10/9/2011 11:43 PM, Mr. B-o-B wrote:
> On 10/9/2011 6:54 PM, Jerry Stuckle cried from the depths of the abyss:
>
>>
>> None of which are a good idea. And so those who keep espousing these
>> crappy solutions (which are off topic in this newsgroup but there are so
>> many of them I will respond anyway):
>
> So just ignore them then :)
>
And spread crappy solutions like you continually provide? No, I'm here
to HELP people - not let them get your crappy advice.
>> And files should be included using link tags, not directly included in
>> the source file directly (unless they are specific to this page - in
>> which case there is no need for conditional includes). That way file can
>> be cached by the browser and/or routers between the web server and the
>> client, decreasing both network traffic and server load.
>>
>
> Again, my original post fits these specs:
>
> if (@isset $jerrys_css) {
> echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"jerry_css.css\"
> />";
> }
>
> Then just set $jerry_css = 1 when needed. Imagine that. You are not
> decreasing network traffic, not increasing server load, cache is
> irrelevant as it's only cached in the pages that need it, you are using
> .js/.css via link tags.
>
>
To quote you:
----if (@isset $javascript01){
put code here
}
if (@isset $javascript02){
put code here
}
if (@isset $css01){
put code here
}
etc....
----
Crappy advice.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|