Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > "object expected" error in ie

Reply
Thread Tools

"object expected" error in ie

 
 
jman
Guest
Posts: n/a
 
      03-09-2008
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?
 
Reply With Quote
 
 
 
 
SAM
Guest
Posts: n/a
 
      03-09-2008
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
 
Reply With Quote
 
 
 
 
endangeredmassa@gmail.com
Guest
Posts: n/a
 
      03-09-2008
On Mar 9, 9:07 am, jman <(E-Mail Removed)> 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>
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      03-10-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> On Mar 9, 9:07 am, jman <(E-Mail Removed)> 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/....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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xffc Thread 0x228 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-30-2006 03:16 PM
Error connecting to SQLExpress 2005 locally (error: 26 - Error Locating Server/Instance Specified) hfk0 ASP .Net 2 03-27-2006 08:43 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 1 03-24-2006 04:20 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-24-2006 02:22 PM
Error 500: ERROR: Cannot forward. Writer or Stream already obtained. Error JavaQueries Java 1 03-01-2005 06:30 PM



Advertisments