Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery mobile switch statement bug?
    primarykey
    data
    text
    <p>I'm making a jQuery Mobile site and have encountered a strange problem with a JS switch statement I'm trying to use in my code as a demonstration.</p> <p>I have an index.html page with a listview with a number of options, one which redirects to the page I'm working on, say test.html.</p> <p>In test.html, I have this switch statement:</p> <pre><code>&lt;script&gt; function myFunction() { var d=new Date().getDay(); switch (d) { case 0:    alert("Today it's Sunday");    break; case 1:    alert("Today it's Monday");   break; case 2:    alert("Today it's Tuesday");   break; case 3:    alert("Today it's Wednesday");    break; case 4:    alert("Today it's Thursday");    break; case 5:    alert("Today it's Friday");    break; case 6:    alert("Today it's Saturday");    break; } } &lt;/script&gt; </code></pre> <p>The function is called by a button.</p> <p>Here's the problem, when I try to access this page from index.html, the page gets stuck loading (it shows JQMs spinning circle). If it remove the cases from the switch statement, the page loads fine. Also, I have swipe events on other pages with go to this page, and the same thing happens when I try to swipe to it, so it's not a problem with index.html most likely.</p> <p>However, if I directly access this page via URL, it works fine, and the switch statement works. </p> <p>Here is the line of code in index.html:</p> <pre><code>&lt;li&gt;&lt;a href="test.html"&gt;&lt;img src="images/test.png" alt="Test"/&gt;&lt;p&gt;This is a test page.&lt;/p&gt;&lt;/a&gt;&lt;/li&gt; </code></pre>
    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.
    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