Diskusija z wužiwarjom:Tlustulimu/test.js
Nowy kode1[žórłowy tekst wobdźěłać]
To snadź je wužitny kode ze strony http://www.webmasterworld.com/forum91/4155.htm.
var str = navigator.useragent; var gecko = str.replace(/^Mozilla.*rv:¦\).*$/g, '' ) ¦¦ ( /^rv\:¦\).*$/g, '' ); var version = gecko.substring(0,3);
Nowy kode2[žórłowy tekst wobdźěłać]
To je kode po knize "Javascript" wot Tobias Hauser, z lěta 2003, wot stronow 370 a 371 - ISBN 3-8272-6465-0.
var ua = navigator.userAgent; var pos = ua.indexOf("rv:"); var string = ua.substring(pos + 3, pos +7); var gecko = parseFloat(string);