1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

JavaScript onload function

Discussion in 'Web Development' started by indumathi, Nov 11, 2008.

  1. indumathi

    indumathi New Member

    hi all,

    is it wise to use onload in body tag? for ex: <body onload="sample()" >

    and will it affect the other js already included in a page?

    and will the jss and css load when the page loads?

    thnks,
    indu
     
  2. ishkey

    ishkey Moderator, Logos, Sports Crests Staff Member Verified Member

    Sure - The browser triggers "onLoad" when the document is finished loading.
    No it will not affect the other "js" on the page.
    The "css" is call first, followed by those "js" encased in the "head section", followed by the body.
    Go for it.