473,394 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Javascript not working in IE

I have some Javascript that is not working at all in IE and works fine in
Mozilla.

I stripped the page down to nothing where it only calls the function which
only does an alert.

I don't get the alert and I get an error that says:

Object expected

What is causing these problems?

Here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<script language="javascript1.4">
function SalaryDisplay(me,dest)
{
alert("inside SalaryDisplay");
}
</script>
<title>Home Page</title>
</head>
<body class="ApplicantBody">
<br>From:<input name="WagesMin" type="text" size="10" id="WagesMin"
onChange="SalaryDisplay(this,'SalaryMin');" />
</body>
</html>
Thanks,

Tom
Jul 23 '05 #1
5 1417
tshad wrote:
I have some Javascript that is not working at all in IE and works fine in
Mozilla.

I stripped the page down to nothing where it only calls the function which
only does an alert.

I don't get the alert and I get an error that says:

Object expected

What is causing these problems?

Here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<script language="javascript1.4">


That line above is walking, living, typed out reason to never use the
language attribute. Evidently IE ignores that version so it never sees
the script block. Change it to the preferred (required) type attribute
and it "works" in IE6:

<script type="text/javascript">

<FAQENTRY>
Something about the type attribute being required and language
attributes causing problems in certain browsers? javascript1.4 being a
problem in IE6.
</FAQENTRY>

A search of the FAQ for "type=" and "language=" are unfound. Is it
covered in a Notes page somewhere?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2

"Randy Webb" <Hi************@aol.com> wrote in message
news:hq********************@comcast.com...
tshad wrote:
I have some Javascript that is not working at all in IE and works fine in
Mozilla.

I stripped the page down to nothing where it only calls the function
which only does an alert.

I don't get the alert and I get an error that says:

Object expected

What is causing these problems?

Here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<script language="javascript1.4">
That line above is walking, living, typed out reason to never use the
language attribute. Evidently IE ignores that version so it never sees the
script block. Change it to the preferred (required) type attribute and it
"works" in IE6:

<script type="text/javascript">

<FAQENTRY>
Something about the type attribute being required and language attributes
causing problems in certain browsers? javascript1.4 being a problem in
IE6.
</FAQENTRY>

A search of the FAQ for "type=" and "language=" are unfound. Is it covered
in a Notes page somewhere?


You're right.

Apparently, you don't need the "type" attribute if you use
language="javascript" and you need the "type" attribute if you use
language=javascript1.4.

I just love consistency.

Thanks,

Tom
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly

Jul 23 '05 #3
tshad wrote:
"Randy Webb" <Hi************@aol.com> wrote in message
news:hq********************@comcast.com...


<--snip-->

A search of the FAQ for "type=" and "language=" are unfound. Is it covered
in a Notes page somewhere?

You're right.

Apparently, you don't need the "type" attribute if you use
language="javascript" and you need the "type" attribute if you use
language=javascript1.4.


Dont use the language attribute, always use the type attribute. Now you
have consistency.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #4
tshad wrote:
[...]

You're right.

Apparently, you don't need the "type" attribute if you use
language="javascript" and you need the "type" attribute if you use
language=javascript1.4.

I just love consistency.


As Randy indicated, 'language' is depreciated, 'type' is required:

type = content-type [CI]
This attribute specifies the scripting language of the element's
contents and overrides the default scripting language. The
scripting language is specified as a content type (e.g.,
"text/javascript"). Authors must supply a value for this
attribute. There is no default value for this attribute.

language = cdata [CI]
Deprecated. This attribute specifies the scripting language of the
contents of this element. Its value is an identifier for the
language, but since these identifiers are not standard, this
attribute has been deprecated in favor of type.

<URL:http://www.w3.org/TR/html401/interact/scripts.html#edef-SCRIPT>

--
Rob
Jul 23 '05 #5
"RobG" <rg***@iinet.net.auau> wrote in message
news:9q****************@news.optus.net.au...
tshad wrote:
[...]

You're right.

Apparently, you don't need the "type" attribute if you use
language="javascript" and you need the "type" attribute if you use
language=javascript1.4.

I just love consistency.


As Randy indicated, 'language' is depreciated, 'type' is required:

type = content-type [CI]
This attribute specifies the scripting language of the element's
contents and overrides the default scripting language. The
scripting language is specified as a content type (e.g.,
"text/javascript"). Authors must supply a value for this
attribute. There is no default value for this attribute.

language = cdata [CI]
Deprecated. This attribute specifies the scripting language of the
contents of this element. Its value is an identifier for the
language, but since these identifiers are not standard, this
attribute has been deprecated in favor of type.

<URL:http://www.w3.org/TR/html401/interact/scripts.html#edef-SCRIPT>


That should solve the problems.

Thanks,

Tom
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
iam_clint
by: iam_clint | last post by:
http://adomas.org/javascript-mouse-wheel/ heres a document i found for javascripting with the mouse wheel. pretty interesting good reference if anyone wanted todo anything with the mouse wheel.
1
by: Rajesh Rao | last post by:
Hi guys, following url works in Fire Fox but not On IE. http://www.dell.com/content/topics/topic.aspx/global/hybrid/snp/en/storage_type?c=us&cs=19&l=en&ModelSelection=121317&s=dhs
1
by: 2007boy | last post by:
I am puzzled by a problem I am having with a javascript that is working on my computer (mac osx) but fail when put online. it happens only with the old IE 5.2 for mac and the iCab browsers. the code...
6
by: ApOG | last post by:
Hello everyone, I have this javascript code working perfectly with IE, but with firefox nothing happens when running the function... function add_div_field () { var ni =...
1
by: web20tester | last post by:
Hi all, I am new to javascript. I have this script working fine in IE but cannot work in firefox. Really appreciate on any guidance. search0.js function Search(str) { var...
16
by: shyamg | last post by:
Hi, this is my javascript validating the fields in mozilla FF but its working and validating only one field. how to write the and how to works the script .................. function...
3
by: yurcheg | last post by:
Hi, I've searched the forum for this problem but haven't found anything relevant. I've got a javascript code which dynamically creates list-boxes in a form. It works perfectly fine in IE, but in...
26
by: itgaurav198 | last post by:
Hi, I have the following script function submitForm1() { document.forms.action="SearchRecords"; document.forms.submit(); }
1
by: Rewire | last post by:
This script seems to work fine with firefox but not with IE. It just sets style="display:none" or style="display:" to show / hide submenu items on my menu. I've just tried making it save to a cookie...
7
by: printline | last post by:
Hello out there.... I have a javascript that goes like this: <script language="javascript"> function checkFields9(){ if (shopform.totalhwtemp.value<=16) { return...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.