"object expected" error in ie

Discussion in 'Javascript' started by jman, Mar 9, 2008.

  1. jman

    jman Guest

    i'm getting an "object expected" error in ie - not ff.

    in the BODY onload attribute i call a function that's
    loaded from an external file.

    i've narrowed the error down to the fact it cannot find
    this function.

    <script src="external.js">

    <body onload="func()">

    func() is in external.js

    works in other browsers - any help?
    jman, Mar 9, 2008
    #1
    1. Advertising

  2. jman

    SAM Guest

    jman a écrit :
    > i've narrowed the error down to the fact it cannot find
    > this function.
    >
    > <script src="external.js">
    >
    > <body onload="func()">
    >
    > func() is in external.js
    >
    > works in other browsers - any help?


    <script src="external.js" type="text/javascript"></script>

    <body onload="func()">


    certainly my Fx would do as your IE

    --
    sm
    SAM, Mar 9, 2008
    #2
    1. Advertising

  3. jman

    Guest

    On Mar 9, 9:07 am, jman <> wrote:
    > i'm getting an "object expected" error in ie - not ff.
    >
    > in the BODY onload attribute i call a function that's
    > loaded from an external file.
    >
    > i've narrowed the error down to the fact it cannot find
    > this function.
    >
    > <script src="external.js">
    >
    > <body onload="func()">
    >
    > func() is in external.js
    >
    > works in other browsers - any help?


    As SAM said, IE requires that you open and close the script tag. Try
    doing this:
    <script src="external.js" type="text/javascript"></script>
    , Mar 9, 2008
    #3
  4. wrote:
    > On Mar 9, 9:07 am, jman <> wrote:
    >> [...]
    >> i've narrowed the error down to the fact it cannot find
    >> this function.
    >>
    >> <script src="external.js">
    >>
    >> <body onload="func()">
    >>
    >> func() is in external.js
    >>
    >> works in other browsers - any help?

    >
    > As SAM said, IE requires that you open and close the script tag.


    That is required in *all* user agents, because anything else is invalid
    markup, and relying on error correction is recommended against, because
    it is error-prone. The end tag of the `script' element is not optional:

    http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.1
    http://validator.w3.org/


    PointedEars
    --
    realism: HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness: XHTML 1.1 as application/xhtml+xml
    -- Bjoern Hoehrmann
    Thomas 'PointedEars' Lahn, Mar 10, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kiyomi

    Object Expected error

    Kiyomi, Jan 6, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    11,218
    Kiyomi
    Jan 10, 2006
  2. =?Utf-8?B?R3JlZw==?=
    Replies:
    4
    Views:
    5,844
    sirfunusa
    Apr 5, 2006
  3. =?Utf-8?B?YXNod2lu?=

    Runtime error: Object expected

    =?Utf-8?B?YXNod2lu?=, Oct 3, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    779
    =?Utf-8?B?YXNod2lu?=
    Oct 12, 2007
  4. Jeff
    Replies:
    3
    Views:
    8,622
    Alexey Smirnov
    Jun 2, 2009
  5. Steve Chapel
    Replies:
    15
    Views:
    231
Loading...

Share This Page