Friday, January 22, 2010
If you’re using Skype regularly, perhaps even on an everyday basis like I do, you might have noticed an annoying new feature that is shipped with Skype: “Mood Messages”. If you’re expecting new chat messages from someone and the mood messages kick in your first reaction will be that you have received a message – so you open the Skype chat window with a confused look on your face (because there are no new messages) until you realize that once again the lovely “Mood Messages” have foiled you.
I still don’t understand what these messages actually are. And who at Skype made them enabled by default. But let’s just try to solve the problem instead.
For some reason the setting to disable these messages is not in the Preferences dialog of Skype, instead it’s hidden pretty well. Here’s what you need to do.
- Open Skypes main window (the buddy list).
- In the top you’ll find the “Show History” button, which changes to a notification counter if you have new unread notifications. As for me, I have 1 unread notification, a dreadful “Mood Message”. Double-click this message and it will open in Skypes chat window.
In the chat drawer, right click on “Mood Messages” and select “Chat Notification Settings…”
- A dialog opens, simply select “Do not notify me” and also remember to check “Mark unread messages as read immediately”.
That should do it.
Wednesday, January 20, 2010
Recently I was updating a JavaScript function which simply added another element to a page, complete with content. The innerHTML function was used. However, I was very confused that some HTML elements I’d added using innerHTML were stripped on rendering.
Problem: I was trying to add a new row plus cells to an existing table on a page. It seems like innerHTML in Firefox strips new rows and cells (tr and td). Example:
<table id="table1">
<tr>
<td><h3>Existing header</h3></td>
</tr>
</table>
<script>
var newRow = document.createElement("tr");
newRow.innerHTML = '\
<tr>\
<td><h3>New header</h3>\
</tr>\
';
document.getElementById("table1").appendChild(newRow);
</script>
This would simply output:
<table id="table1">
<tr>
<td><h3>Existing header</h3></td>
</tr>
<h3>New header</h3>
</table>
…Which is incorrect by web standards and is not much to work with.
Solution: Instead of inserting the new element (the <tr>) after the innerHTML string is added, I did it before. It seems like the browser doesn’t like that we add elements that are strictly associated with tables unless it actually knows for sure that they’ll be added to the correct structure.
This is the simple solution for disappearing tds and rows:
<script>
var newRow = document.createElement("tr");
document.getElementById("table1").appendChild(newRow);
newRow.innerHTML = '\
<tr>\
<td><h3>New header</h3>\
</tr>\
';
</script>