Click to See Complete Forum and Search --> : Opera 6 imported script problem


toicontien
05-05-2003, 06:33 PM
Forgive me for not producing the exact code, but has anyone noticed a problem with Opera 6.04 when you try to import a JavaScript via the SCRIPT tag:

**NOTE: Oops. Spelling mistake on my part, I corrected the word language. That wasn't the problem, but thanks for pointing it out :o


<script type="text/javascript" langauge="JavaScript" src="url_to_script.js"></script>


The errors I was getting were Objected expected errors. I was simply passing a text string containing the ID of a DIV and then changing the background color:

In the script itself:

// after making sure the browser supports the standard DOM

// the variable "object" contains the ID of a DIV

document.getElementById(object).style.backgroundColor = "#cc0000";


Again, this isn't the EXACT code, but extremely close to it. I've since found a CSS workaround for this problem, but I've encountered it on my personal web site also.


http://users.tm.net/gburghardt/


The left menu has a similar affect.

The funky thing is, it worked fine in IE 5 PC/Mac and IE6/PC, and Netscape/Mozilla.

Once I embedded the same code in the HTML document itself, the script errors stopped.:o :o

gil davis
05-06-2003, 05:49 AM
Spelling, perhaps?<script type="text/javascript" lanugauge="JavaScript" src="url_to_script.js"></script>Or is this a typo?

Charles
05-06-2003, 05:54 AM
And if not, the 'language' attribute was depricated back in 1997 and might be the problem. And as it will cause Netscape to behave in certain non-standard ways you would do well to rid yourself of its use.