Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have several mistakes in function notification(), see my comments:</p> <pre><code>function notification() { var index = 2; //Why are you assigning value to "content" for twice? var content = document.getElementById('refreshMessages').childNodes[index]; /* * function getElementByTagName is undefined, should be getElementsByTagName, * 's' is missing. And [1] means the second one not the first one, make sure * that's exactly what you want. */ var content = document.getElementById('refreshMessages').getElementByTagName("tr")[1]; /* * content is a tr dom object, content.toString() is something like "[object]". * If you want to get content inside a cell, you should use cell.innerHTML. * e.g. A table: * &lt;table id="refreshMessages"&gt; * &lt;tr&gt;&lt;td&gt;Hello world&lt;/td&gt;&lt;/tr&gt; * &lt;/table&gt; * var table = document.getElementById('refreshMessages'); * var firstTr = table.getElementsByTagName("tr")[0]; * var firstTd = firstTr.getElementsByTagName("td")[0]; * alert(firstTd.innerHTML); //alerts "Hello world" */ var knownContent = content.toString(); //I doubt these functions really get invoked cuz there's javascript error above. updater.start(); updater2.start(); //assigning twice, "getElementByTagName" is missing "s" var newContent = document.getElementById('refreshMessages').childNodes[index]; var newContent = document.getElementById('refreshMessages').getElementByTagName("tr")[1]; //Remove toString(), use innerHTML i metioned above. if(knownContent != newContent.toString()) { newMessage(); knownContent = newContent; } //You miss an "=" here, to judge a equals b, you should use "==" else if(knownContent = newContent.toString()) { alert("No need to flash title."); } } </code></pre>
    singulars
    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