I've been trying to learn this myself several hours and just had to give up and plead for mercy.
I'm writing a greasemonkey script that interacts with my work OWA (Outlook Web Access), nothing fancy at all.
The goal is to find and count the number of times an image (which has no name or id) exists within my 'inbox'.
Here's my simple test that fails and I sure wish I knew why:
var ilist = document.images;
for(var i = 0; i < ilist.length; i++) {
if(ilist[i] == "msg-unrd.gif") {
// found the image
alert('Found new message image!');
}
}
The intent is to take the count of those 'new message' images and place them into a variable that will be used within the page title.
parent.document.title = "(..+UNREAD_COUNT+..) Inbox";
The source of the 'inbox' and the message I'm trying to detect and count looks like so:
img alt="Message: Unread" src="8.1.393.1/themes/base/msg-unrd.gif"
I know there are a few other greasemonkey scripts written for OWA, but the source has changed since the ones I've tried to use so they fail too.
Hope your holidays have been great!