aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/idbopendbrequest/blocked_event/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/web/api/idbopendbrequest/blocked_event/index.html')
-rw-r--r--files/fr/web/api/idbopendbrequest/blocked_event/index.html22
1 files changed, 11 insertions, 11 deletions
diff --git a/files/fr/web/api/idbopendbrequest/blocked_event/index.html b/files/fr/web/api/idbopendbrequest/blocked_event/index.html
index 0c9bdbf588..6789721695 100644
--- a/files/fr/web/api/idbopendbrequest/blocked_event/index.html
+++ b/files/fr/web/api/idbopendbrequest/blocked_event/index.html
@@ -10,7 +10,7 @@ original_slug: Web/API/IDBRequest/blocked_event
<dl>
<dt style="float: left; text-align: right; width: 120px;">Spécification</dt>
- <dd style="margin: 0 0 0 120px;"><a class="external" href="http://www.w3.org/TR/IndexedDB/#request-api">IndexedDB</a></dd>
+ <dd style="margin: 0 0 0 120px;"><a href="http://www.w3.org/TR/IndexedDB/#request-api">IndexedDB</a></dd>
<dt style="float: left; text-align: right; width: 120px;">Interface</dt>
<dd style="margin: 0 0 0 120px;">IDBVersionChangeEvent</dd>
<dt style="float: left; text-align: right; width: 120px;">Propagation</dt>
@@ -69,20 +69,20 @@ original_slug: Web/API/IDBRequest/blocked_event
<h2 id="Exemple">Exemple</h2>
-<pre class="brush:js; line-numbers language-js"><code class="language-js"><span class="keyword token">var</span> req1 <span class="operator token">=</span> indexedDB<span class="punctuation token">.</span><span class="function token">open</span><span class="punctuation token">(</span><span class="string token">"addressbook"</span><span class="punctuation token">,</span> <span class="number token">3</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+<pre class="brush:js">var req1 = indexedDB.open("addressbook", 3);
-req1<span class="punctuation token">.</span>onsuccess <span class="operator token">=</span> <span class="keyword token">function</span><span class="punctuation token">(</span> event <span class="punctuation token">)</span> <span class="punctuation token">{</span>
- <span class="keyword token">var</span> addressbookDB <span class="operator token">=</span> event<span class="punctuation token">.</span>target<span class="punctuation token">.</span>result<span class="punctuation token">;</span>
+req1.onsuccess = function( event ) {
+ var addressbookDB = event.target.result;
- <span class="comment token">// Essayons d'ouvrir la même base de données avec une version de révision plus élevée</span>
- <span class="keyword token">var</span> req2 <span class="operator token">=</span> indexedDB<span class="punctuation token">.</span><span class="function token">open</span><span class="punctuation token">(</span><span class="string token">"addressbook"</span><span class="punctuation token">,</span> <span class="number token">4</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+ // Essayons d'ouvrir la même base de données avec une version de révision plus élevée
+ var req2 = indexedDB.open("addressbook", 4);
- <span class="comment token">// Dans ce cas, le handler onblocked</span> sera exécuté
- req2<span class="punctuation token">.</span>onblocked <span class="operator token">=</span> <span class="keyword token">function</span><span class="punctuation token">(</span> e <span class="punctuation token">)</span> <span class="punctuation token">{</span>
- console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span>e<span class="punctuation token">)</span>
- <span class="punctuation token">}</span><span class="punctuation token">;</span>
+ // Dans ce cas, le handler onblocked sera exécuté
+ req2.onblocked = function( e ) {
+ console.log(e)
+ };
-<span class="punctuation token">}</span><span class="punctuation token">;</span></code></pre>
+};</pre>
<h2 id="Evénements_liés">Evénements liés</h2>