Re: PHP attaching css and JS files to current page
| From: | Ashley Sheridan | Date: | Sun, 30 Nov 2008 13:55:24 +0000 |
| Subject: | Re: PHP attaching css and JS files to current page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-283927@lists.php.net to get a copy of this message | ||
On Sun, 2008-11-30 at 14:23 +0100, Alain Roger wrote:
> Hi,
>
> is there a way how a PHP class can attach JS (javascript) and CSS documents
> to current web page in which the class is instanced ?
> till now i used an "echo" which "write" a <script></script>
> code into
> current document.
> in this javascript, i used to have a createElement function to attache
> C\other CSS or JS file.
>
> it's not so clean and maybe a better possibility exists. Thanks to let me
> know.
>
Can you not just write all of the CSS/Javascript that you need right
from the get-go in the same place you're writing out your Javascript
now?
Ash
www.ashleysheridan.co.uk