1 Replies - 391 Views - Last Post: 13 August 2012 - 03:38 PM

#1 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

javascript behind html closing tag?

Posted 13 August 2012 - 03:33 PM

what does it mean when javascript is placed after </html>?
I tested it, and it executed right after the page load, before i even take any action?
Is This A Good Question/Topic? 0
  • +

Replies To: javascript behind html closing tag?

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1004
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: javascript behind html closing tag?

Posted 13 August 2012 - 03:38 PM

It doesn't "mean" anything, of course it would be executed as soon as it's loaded, unless you're subscribing to some DOM event (like it's loaded).

It would have the same effect as placing it before the </body> tag, apart from the latter would be somewhat more valid than placing it after </html>, which would make malformed HTML in any instance.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1