informatique:javascript:tests_de_compatibilite
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
informatique:javascript:tests_de_compatibilite [04/05/2018 20:27] – créée cyrille | informatique:javascript:tests_de_compatibilite [05/05/2018 19:12] – cyrille | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | |||
+ | ====== Is javascript works ? ====== | ||
+ | |||
+ | Should be write ' | ||
+ | |||
< | < | ||
+ | < | ||
+ | document.write('< | ||
+ | </ | ||
+ | </ | ||
+ | ====== toLocaleDateString() ====== | ||
+ | |||
+ | < | ||
< | < | ||
- | document.write(' | + | var d = ' |
+ | document.write(' | ||
+ | d = new Date(Date.parse(d)); | ||
+ | document.write('< | ||
+ | document.write('< | ||
</ | </ | ||
+ | </ | ||
+ | ===== Workaround ===== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | function date_as_slug( date ) | ||
+ | { | ||
+ | var y = date.getFullYear(), | ||
+ | m = 1+date.getMonth(), | ||
+ | d = date.getDate(), | ||
+ | h = date.getHours(), | ||
+ | mn = date.getMinutes(); | ||
+ | | ||
+ | } | ||
+ | |||
+ | document.write( '< | ||
+ | |||
+ | var date = ' | ||
+ | d = new Date(Date.parse(date)); | ||
+ | document.write('< | ||
+ | |||
+ | date = ' | ||
+ | d = new Date(Date.parse(date)); | ||
+ | document.write('< | ||
+ | |||
+ | </ | ||
</ | </ | ||
+ | |||
+ | ====== Object.assign() ====== | ||
+ | |||
+ | ===== Assign simple with scalar properties ===== | ||
+ | |||
+ | Should be write 1,2 : | ||
+ | |||
+ | < | ||
+ | < | ||
+ | try { | ||
+ | var o1 = { a:1 }; | ||
+ | var o2 = Object.assign( o1, { b:2 } ); | ||
+ | | ||
+ | } catch ( e ){ | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== Assign simple with complex properties ===== | ||
+ | |||
+ | Should be write 1,2 : | ||
+ | |||
+ | < | ||
+ | < | ||
+ | try { | ||
+ | var o1 = { a:1 }; | ||
+ | var o2 = Object.assign( o1, { b: | ||
+ | | ||
+ | } catch ( e ){ | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ |
informatique/javascript/tests_de_compatibilite.txt · Dernière modification : 05/05/2018 19:17 de cyrille