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
including CSS & JS on only pages that need that CSS & JS [message #175565] Sun, 09 October 2011 06:51 Go to previous message
paris2venice is currently offline  paris2venice
Messages: 9
Registered: October 2011
Karma:
Junior Member
I'm still a newbie at PHP. What would be the right way to include CSS
and Javascript such that I could add CSS and JS just for those pages
that need it?

Would it be something like this? Is this how you do it?

<?
php require_once './css.php'; /* css.php contains
doctype, meta & css needed universally */
?>

<!-- link href= calls to CSS needed on local page only -->

<?
php require_once './js.php'; /* js.php contains
javascript calls needed universally */
?>

<!-- script type="text/javascript" calls to Javascript needed on
local page only -->
</head>


Thanks a bunch for your help.
[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: Sat Nov 23 01:33:01 GMT 2024

Total time taken to generate the page: 0.05100 seconds