Note that there are some explanatory texts on larger screens.

plurals
  1. POHtml5 WebSql transaction behaves strangely with alert
    primarykey
    data
    text
    <p>The WebSql's transaction is behaving strangely when I put some alerts in the code. I have three transactions to do. These are t1,t2 and t3.</p> <p>The following code works perfectly fine as expected.</p> <pre><code> var db = openDatabase('DBTest', "1.0", "Example DB", "200000"); db.transaction(function(tx) { alert('Tranasction.1........'); jQuery('body').append('&lt;h1&gt;Added a h1 by t1&lt;/h1&gt;'); }); db.transaction(function(tx) { alert('Tranasction.2........'); jQuery('body').append('&lt;h1&gt;Added a h1 by t2&lt;/h1&gt;'); }); db.transaction(function(tx) { alert('Transaction.3.........'); jQuery('body').append('&lt;h1&gt;Added a h1 by t3&lt;/h1&gt;'); }); </code></pre> <p>But, when I insert an alert statement just before doing a transaction. The things do not work as expected. </p> <p>For example. If I put an alert('An alert just before transaction t3'); </p> <p>The code after the change looks like this:</p> <pre><code>var db = openDatabase('DBTest', "1.0", "Example DB", "200000"); db.transaction(function(tx) { alert('Tranasction.1........'); jQuery('body').append('&lt;h1&gt;Added a h1 by t1&lt;/h1&gt;'); }); db.transaction(function(tx) { alert('Tranasction.2........'); jQuery('body').append('&lt;h1&gt;Added a h1 by t2&lt;/h1&gt;'); }); //THIS ALERT IS ADDED alert('An alert just before transaction t3'); db.transaction(function(tx) { alert('Transaction.3.........'); jQuery('body').append('&lt;h1&gt;Added a h1 by t3&lt;/h1&gt;'); }); </code></pre> <p><strong>Change in behavior after the changes: The first two transactions do not happen.</strong></p> <p>Is it the expected behaviour. If yes, then how is it justified?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload