Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Do czego jest to potrzebne
Messie
post
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 19.07.2016

Ostrzeżenie: (0%)
-----


Siema ostatnio szukając po necie znalazłem taki kawałek kodu:

[JAVASCRIPT] pobierz, plaintext
  1. function browser() {
  2.  
  3. var isOpera = !!(window.opera && window.opera.version); // Opera 8.0+
  4. var isFirefox = testCSS('MozBoxSizing'); // FF 0.8+
  5. var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
  6. // At least Safari 3+: "[object HTMLElementConstructor]"
  7. var isChrome = !isSafari && testCSS('WebkitTransform'); // Chrome 1+
  8. //var isIE = /*@cc_on!@*/false || testCSS('msTransform'); // At least IE6
  9.  
  10. function testCSS(prop) {
  11. return prop in document.documentElement.style;
  12. }
  13.  
  14. if (isOpera) {
  15.  
  16. return false;
  17.  
  18. }else if (isSafari || isChrome) {
  19.  
  20. return true;
  21.  
  22. } else {
  23.  
  24. return false;
  25.  
  26. }
  27.  
  28. }
[JAVASCRIPT] pobierz, plaintext


Do czego to służy ?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 20:53