user383543
user383543

Reputation: 3

Javascript is called in IE but not in Chrome and FF

I have this code in my page

<script language="JavaScript" defer>totCb["19782"] = 2;</script>

I call this almost in the end of the script, this should add the new value to the array totCb. This works in IE but not in Chrome or FF, why?

Upvotes: 0

Views: 148

Answers (3)

Michael Berkowski
Michael Berkowski

Reputation: 270677

The language attribute is deprecated in favor of the type attribute. Instead try specifying it as such:

<script type="text/javascript" defer="defer">
  totCb["19782"] = 2;
</script>

According to w3 schools, defer is only supported by IE.

Upvotes: 0

zzzzBov
zzzzBov

Reputation: 179176

I have no idea what doctype you're using, but in HTML5:

The defer and async attributes must not be specified if the src attribute is not present.

Upvotes: 3

rhesus
rhesus

Reputation: 9

IE is the only browser that supports the defer "attribute" in the script tag.

Upvotes: -1

Related Questions