Steven Guan
Steven Guan

Reputation: 43

Intl is not defined firefox

I have following java scripts code which runing well in chrome but fail in firefox and IE. the error message of FF is 'ReferenceError: Intl is not defined' the error message of IE is 'SCRIPT5009: 'Intl' is undefined '

<script>
var co = new Intl.Collator('pinyin');
console.log(co);
var co = new Intl.Collator('zh-Hans');
console.log(co);
var co = new Intl.Collator('zh-Hans-CN');
console.log(co);
</script>

I just wonder why the standard object Intl can't be refer in FF or IE? did I miss something?

Upvotes: 3

Views: 4134

Answers (2)

Pointy
Pointy

Reputation: 413737

It's a new API that's not supported by Firefox (as of the date of this writing).

See the MDN page and its section about browser support for the feature.

Note that it's also unsupported by IE prior to IE 11, and it's unsupported by desktop and iOS Safari.

Upvotes: 3

Mihai Nita
Mihai Nita

Reputation: 5787

Here is the current status of Intl support:

http://mihai-nita.net/2013/07/28/javascript-internationalization-api/

Upvotes: 0

Related Questions