FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » including CSS & JS on only pages that need that CSS & JS
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: including CSS & JS on only pages that need that CSS & JS [message #175579 is a reply to message #175577] Mon, 10 October 2011 03:43 Go to previous messageGo to previous message
Mr. B-o-B is currently offline  Mr. B-o-B
Messages: 42
Registered: April 2011
Karma:
Member
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 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.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: .htaccess vs PHP header(location:)
Next Topic: How to redirect user based on user country?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 20:53:22 GMT 2024

Total time taken to generate the page: 0.04226 seconds