Hi,

> I have one file that do all my sitemanagment, it's a very simple php
> that i use like this: index.php?menu=file&lang=de&option=xyz. Inside
> index.php i just include the files needed (of course with a test to only
> proceed menupoints available). So the jquery.js file is allways loaded
> in head like David mentioned in his previous post.

I understand you currently include jQuery like this:

<script type="text/javascript">
<? include('jQuery.js') ?>
// ... your code here
</script>

Try this:

<script src="jQuery.js" type="text/javascript"></script>
<script type="text/javascript">
// ... your code here   
</script>

Then jQuery.js is loaded and cached by the browser as external files. It is in 
some way similar to images which can be cached independently from the HTML.

If your JS code only needs a fiewv values from PHP you can do it like this:

<script type="text/javascript">
myconf = {
        bgcolor: '<?= $bgcolor ?>',
        color: '<?= $color ?>',
        haircolor: '<?= $haircolor ?>'
}
</script>
<script src="jQuery.js" type="text/javascript"></script>
<script src="mystuff.js" type="text/javascript"></script>

Then you can use the global variable myconf in mystuff.js and keep mystuff.js 
unchanged.

Christof

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to