Validator gives that error when you've something outside </body>. Just move your script tags inside <body>, or keep them in <head>.