Содержание
Function
Modernizr uses feature detection, rather than checking the browser’s property, to discern what a browser can and cannot do. It considers feature detection more reliable since the same rendering engine may not necessarily support the same things in two different browsers using that engine. In addition, some users change their user agent string to get around websites that block features for browsers with specific user agent settings, despite their browsers having the necessary capabilities.
Modernizr offers tests for more than 250 features, then creates a JavaScript object (named «Modernizr») that contains the results of these tests as boolean properties. It also adds classes to the HTML element based on what features are and are not natively supported.
To perform feature detection tests, Modernizr often creates an element, sets a specific style instruction on that element and then immediately tries to retrieve that setting. Web browsers that understand the instruction will return something sensible; browsers that don’t understand it will return nothing or «undefined». Modernizr uses the result to assess whether that feature is supported by the web browser.[citation needed]
Many tests in the documentation come with a small code sample to illustrate how a specific test can be used in web development workflow.
Распространенные сообщения об ошибках в Modernizr-2.0.6.min.js
Наиболее распространенные ошибки modernizr-2.0.6.min.js, которые могут возникнуть на компьютере под управлением Windows, перечислены ниже:
- «Ошибка в файле Modernizr-2.0.6.min.js.»
- «Отсутствует файл Modernizr-2.0.6.min.js.»
- «Modernizr-2.0.6.min.js не найден.»
- «Не удалось загрузить Modernizr-2.0.6.min.js.»
- «Не удалось зарегистрировать modernizr-2.0.6.min.js.»
- «Ошибка выполнения: modernizr-2.0.6.min.js.»
- «Ошибка загрузки modernizr-2.0.6.min.js.»
Такие сообщения об ошибках JS могут появляться в процессе установки программы, когда запущена программа, связанная с modernizr-2.0.6.min.js (например, Connectify Hotspot PRO Lifetime), при запуске или завершении работы Windows, или даже при установке операционной системы Windows
Отслеживание момента появления ошибки modernizr-2.0.6.min.js является важной информацией при устранении проблемы
modernise
Past participle: Gerund: ImperativePresentPreteritePresent ContinuousPresent PerfectPast ContinuousPast PerfectFutureFuture PerfectFuture ContinuousPresent Perfect ContinuousFuture Perfect ContinuousPast Perfect ContinuousConditionalPast Conditional
Imperative |
---|
modernise |
modernise |
Present |
---|
I modernise |
you modernise |
he/she/it modernises |
we modernise |
you modernise |
they modernise |
Preterite |
---|
I modernised |
you modernised |
he/she/it modernised |
we modernised |
you modernised |
they modernised |
Present Continuous |
---|
I am modernising |
you are modernising |
he/she/it is modernising |
we are modernising |
you are modernising |
they are modernising |
Present Perfect |
---|
I have modernised |
you have modernised |
he/she/it has modernised |
we have modernised |
you have modernised |
they have modernised |
Past Continuous |
---|
I was modernising |
you were modernising |
he/she/it was modernising |
we were modernising |
you were modernising |
they were modernising |
Past Perfect |
---|
I had modernised |
you had modernised |
he/she/it had modernised |
we had modernised |
you had modernised |
they had modernised |
Future |
---|
I will modernise |
you will modernise |
he/she/it will modernise |
we will modernise |
you will modernise |
they will modernise |
Future Perfect |
---|
I will have modernised |
you will have modernised |
he/she/it will have modernised |
we will have modernised |
you will have modernised |
they will have modernised |
Future Continuous |
---|
I will be modernising |
you will be modernising |
he/she/it will be modernising |
we will be modernising |
you will be modernising |
they will be modernising |
Present Perfect Continuous |
---|
I have been modernising |
you have been modernising |
he/she/it has been modernising |
we have been modernising |
you have been modernising |
they have been modernising |
Future Perfect Continuous |
---|
I will have been modernising |
you will have been modernising |
he/she/it will have been modernising |
we will have been modernising |
you will have been modernising |
they will have been modernising |
Past Perfect Continuous |
---|
I had been modernising |
you had been modernising |
he/she/it had been modernising |
we had been modernising |
you had been modernising |
they had been modernising |
Conditional |
---|
I would modernise |
you would modernise |
he/she/it would modernise |
we would modernise |
you would modernise |
they would modernise |
Examples
Modernizr JavaScript example
<!DOCTYPE html> <html class="no-js" lang="en"> <head> <title>Modernizr - JavaScript Example</title> </head> <body> <p id="result">Modernizr won’t run if javascript is not enabled.</p> </body> <script src="path/to/modernizr.js"></script> <script> elem = document.getElementById('result'); if ( Modernizr.websockets ) { elem.innerHTML = 'Your browser supports WebSockets.'; } else { elem.innerHTML ='Your browser does not support WebSockets.' ; } </script> </html>
CSS example
<!DOCTYPE html> <html class="no-js" lang="en"> <head> <title>Modernizr - CSS Example</title> <style> .wsno, .wsyes, .js .no-js { display none; } /* Modernizr will add one of the following classes to the HTML element based on whether or not WebSockets is supported by the user's browser. */ .no-websockets .wsno, .websockets .wsyes { display block; } </style> </head> <body> <p class="wsno">Your browser does not support WebSockets.</p> <p class="wsyes">Your browser supports WebSockets.</p> <p class="no-js">Modernizr won’t run if javascript is not enabled.</p> </body> <script src="path/to/modernizr.js"></script> </html>
Причины ошибок в файле Modernizr.min.js
Проблемы Modernizr.min.js могут быть отнесены к поврежденным или отсутствующим файлам, содержащим ошибки записям реестра, связанным с Modernizr.min.js, или к вирусам / вредоносному ПО.
Более конкретно, данные ошибки modernizr.min.js могут быть вызваны следующими причинами:
- Поврежденные ключи реестра Windows, связанные с modernizr.min.js / Linux Magazine Issue 192: The Complete Linux Magazine Archive.
- Вирус или вредоносное ПО, которые повредили файл modernizr.min.js или связанные с Linux Magazine Issue 192: The Complete Linux Magazine Archive программные файлы.
- Другая программа злонамеренно или по ошибке удалила файлы, связанные с modernizr.min.js.
- Другая программа находится в конфликте с Linux Magazine Issue 192: The Complete Linux Magazine Archive и его общими файлами ссылок.
- Поврежденная загрузка или неполная установка программного обеспечения Linux Magazine Issue 192: The Complete Linux Magazine Archive.
Features detected by Modernizr
Following is the list of features which can be detected by Modernizr −
Feature | CSS Property | JavaScript Check |
---|---|---|
@font-face | .fontface | Modernizr.fontface |
Canvas | .canvas | Modernizr.canvas |
Canvas Text | .canvastext | Modernizr.canvastext |
HTML5 Audio | .audio | Modernizr.audio |
HTML5 Audio formats | NA | Modernizr.audio |
HTML5 Video | .video | Modernizr.video |
HTML5 Video Formats | NA | Modernizr.video |
rgba() | .rgba | Modernizr.rgba |
hsla() | .hsla | Modernizr.hsla |
border-image | .borderimage | Modernizr.borderimage |
border-radius | .borderradius | Modernizr.borderradius |
box-shadow | .boxshadow | Modernizr.boxshadow |
Multiple backgrounds | .multiplebgs | Modernizr.multiplebgs |
opacity | .opacity | Modernizr.opacity |
CSS Animations | .cssanimations | Modernizr.cssanimations |
CSS Columns | .csscolumns | Modernizr.csscolumns |
CSS Gradients | .cssgradients | Modernizr.cssgradients |
CSS Reflections | .cssreflections | Modernizr.cssreflections |
CSS 2D Transforms | .csstransforms | Modernizr.csstransforms |
CSS 3D Transforms | .csstransforms3d | Modernizr.csstransforms3d |
CSS Transitions | .csstransitions | Modernizr.csstransitions |
Geolocation API | .geolocation | Modernizr.geolocation |
Input Types | NA | Modernizr.inputtypes |
Input Attributes | NA | Modernizr.input |
localStorage | .localstorage | Modernizr.localstorage |
sessionStorage | .sessionstorage | Modernizr.sessionstorage |
Web Workers | .webworkers | Modernizr.webworkers |
applicationCache | .applicationcache | Modernizr.applicationcache |
SVG | .svg | Modernizr.svg |
SVG Clip Paths | .svgclippaths | Modernizr.svgclippaths |
SMIL | .smil | Modernizr.smil |
Web SQL Database | .websqldatabase | Modernizr.websqldatabase |
IndexedDB | .indexeddb | Modernizr.indexeddb |
Web Sockets | .websockets | Modernizr.websockets |
Hashchange Event | .hashchange | Modernizr.hashchange |
History Management | .historymanagement | Modernizr.historymanagement |
Drag and Drop | .draganddrop | Modernizr.draganddrop |
Cross-window Messaging | .crosswindowmessaging | Modernizr.crosswindowmessaging |
addTest() Plugin API | NA | Modernizr.addTest(str,fn) |
Previous Page Print Page
Next Page
modern
ˈmodən adjective belonging to the present or to recent times; not old or ancient. modern عَصْري съвременен moderno moderní modern moderne σύγχρονος, μοντέρνοςmoderno moodne نو moderni moderneמודרני आधुनिक moderan modern modern nútíma- moderno 現代の 현대의 modernus, šiuolaikiškas, dabartinis moderns, mūsdienu- moden modernmoderne, nyerewspółczesny, nowoczesny موډرن،نوى moderno modern современный moderný moderen savremen modern สมัยใหม่ modern 現代的 сучасний جدید hiện đại 现代的
moˈdernity-ˈdəː- noun modernheid عَصْرِيَّه съвременност modernidade modernost die Modernität modernitet η ιδιότητα του να είναι κπ. ή κτ. μοντέρνο(ς) modernidad tänapäevasus تجدد modernisuus modernité מוֹדֶרנִיוּת आधुनिकता modernost korszerűség kemodernan nÿtískuleiki; nútímaviðhorf/-hugsunarháttur modernità 현대성 šiuolaikiškumas, naujoviškumas mūsdienīgums; jauninājums kemodenan moderniteitmodernitet نوى كول modernitate современность modernosť modernost savremenost modern- itet, nymodighet ความทันสมัย modernlik, çağdaşlık 現代性 сучасність حداثت tính chất hiện đại 现代性
ˈmodernness noun moderniteit عَصْرِيَّه модерност modernidade modernost die Modernität det at være moderne η ιδιότητα του να είναι κπ. ή κτ. μοντέρνο(ς) modernidad modernsus تازگی modernisuus modernité מוֹדֶרנִיוּת आधुनिकता suvremenost modernség kemodernan nÿtískuleiki modernità 現代性 현대식 šiuolaikiškumas, naujoviškumas mūsdienīgums bersifat moden modernheid det som er moderne nowoczesność نوى والى modernidade modernitate современность modernosť modernost savremenost modernitet ความทันสมัย modernlik, çağdaşlık 現代 сучасність جدیدیت sự hiện đại 现代
ˈmodernizeˈmodernise verb to bring up to date. moderniseer يُعَصِّر،يُحَدِّث обновявам modernizar (z)modernizovat modernisieren modernisere εκσυγχρονίζωmodernizar tänapäevaseks muutma نوین کردن nykyaikaistaa moderniser לְחַדֵש आधुनिक बनाना modernizirati modernizál memodernkan færa til nútímahorfs modernizzare 近代化する 현대화하다 (su)modernizuoti, moderninti modernizēt memodenkan moderniserenoppdatere, modernisereunowocześnić نوى كول modernizar a moderniza модернизировать (z)modernizovať posodobiti modernizovati modern-isera ทำให้ทันสมัย modernleştirmek 現代化 модернізувати تجدید کرنا hiện đại hóa 使现代化
ˌmoderniˈzationˌmoderniˈsation noun modernisering عَصْرَنَه، تَحْديث модернизация modernização modernizace die Modernisierung modernisering εκσυγχρονισμόςmodernización nüüdisajastamine نو سازی nykyaikaistaminen modernisation מוֹדֶרנִיזַציָה आधुनिकीकरण modernizacija korszerűsítés modernisasi það að færa til nútímahorfs modernizzazione 近代化 현대화 modernizacija modernizācija pemodenan moderniseringoppdatering, modernisering modernizacja بيا جوړونه modernização modernizare модернизация modernizácia posodobitev modernizacija modernisering การทำให้ทันสมัย modernleştirme 現代化 модернізація جدید سازی sự hiện đại hóa 现代化
modern language a language spoken nowadays (as opposed to ancient Greek, Latin etc). moderne taal لُغَه عَصْرِيَّه съвременен език língua moderna živý jazyk lebende Sprache moderne sprog γλώσσα που έχει φυσικούς ομιλητές lengua moderna nüüdiskeel زبان nykykieli langue vivante שָׂפוֹת מוֹדֶרנִיוּת आधुनिक भाषा suvremen jezik élő nyelv bahasa modern lifandi tungumál lingua moderna 現代語 현대 언어 dabartinė/gyva kalba jaunā (mūsdienu) valoda bahasa moden moderne taal levende språk język współczesny د نن ورځى ژبه línguas modernas limbă modernă новый язык živý jazyk živ jezik savremeni jezik modernt språk ภาษาที่ใช้พูดปัจจุบัน yaşayan dil 現代語言 нова мова حالیہ دور کی زبان ngôn ngữ hiện đại 近代语言
Syntax
Before you start using Modernizr, you would have to include its javascript library in your HTML page header as follows −
<script src="modernizr.min.js" type="text/javascript"></script>
As mentioned above, you can create CSS rules based on the feature availability and these rules would apply automatically on the webpage if browser does not support a new featur.
Following is the simple syntax to handle supported and non supported features −
/* In your CSS: */ .no-audio #music { display: none; /* Don't show Audio options */ } .audio #music button { /* Style the Play and Pause buttons nicely */ } <!-- In your HTML: --> <div id="music"> <audio> <source src="audio.ogg" /> <source src="audio.mp3" /> </audio> <button id="play">Play</button> <button id="pause">Pause</button> </div>
Here it is notable that you need to prefix «no-» to every feature/property you want to handle for the browser which does not support them.
Following is the syntax to detect a particular feature through Javascript −
if (Modernizr.audio) { /* properties for browsers that support audio */ } else{ /* properties for browsers that does not support audio */ }
С этим читают