Re: including CSS & JS on only pages that need that CSS & JS [message #175569 is a reply to message #175565] |
Sun, 09 October 2011 12:34 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 10/9/2011 2:51 AM, paris2venice wrote:
> 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.
I'm not sure what you're trying to do here, but these aren't PHP
questions. You're only using PHP to include the files.
You're asking basic layout file layout questions, which vary widely.
The includes can be done in many ways.
The first thing you need to do is learn about various ways to structure
your files. For instance, don't mix your DOCTYPE and other header
information with CSS.
I would suggest you start with a book on basic programming for the web,
including html, css, etc.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|