tags:

views:

38

answers:

1

Hi

I know that a you put the reference to jquery between the head tags as below.

Script src="js/jquery-1.3.2-full.js" type="text/javascript" 

But on a php page with no head tags, where would I place the reference?

thanks

Rifki

A: 

You don't hav to put them in the head-tags but it's recomended. Why don't you structure your php-output with full html?

alopix
Yes you have to. `<script>` tags outside of the `<head>` will result in a buggy page that won't work in some browsers.
NullUserException
So i could add some head tags to my php page, and this wouldnt affect my php code?
Rifki
Some very old browser like Netscape 4.
alopix
@NullUserException Not true (maybe for some really ancient browsers). It is actually recommended to put script tags for certain javascript libraries at the bottom of HTML right before </body>.
Richard Knop
@Richard I personally had JS breaking when inserted out of the head. Since then I haven't put them anywhere but the `<head>`.
NullUserException
@NullUserException : there are just some things js can't do when included in the body, but barring those actions, having it in the body _does_ work, and might I say flawlessly in every browser supporting javascript for years and years.
Wrikken