[Project_owners] Accessing locale strings

eric.jung at yahoo.com eric.jung at yahoo.com
Thu Jul 5 04:37:41 PDT 2007


You could try using nsIWindowMediator.getMostRecentWindow("navigator:browser") to get the appropriate window. From that, you can get the document you seek. http://www.xulplanet.com/references/xpcomref/ifaces/nsIWindowMediator.html

By the way, what does the method getString() do? I haven't seen that used on a w3c dom node.


----- Original Message ----
From: Pete <sneakypete81 at gmail.com>
To: project_owners at mozdev.org
Sent: Wednesday, July 4, 2007 1:46:05 PM
Subject: [Project_owners] Accessing locale strings

Hi,

I'm having trouble accessing strings in my locale folders under
certain circumstances:
* When inside a "load" event listener
* When inside a "setInterval" callback

I'm guessing that the problem is to do with "document" not being
defined in these circumstances. Can anyone recommend a way of getting
access to the locale strings in these cases? I've tried a few things
with nsIWindowMediate, but with no luck.

Example below:

window.addEventListener("load", loadStatusbar, false);

function loadStatusbar()
{
    var str = document.getElementById("updatescanStrings");
    var alertOneChange = str.getString("alertMessage");
// Causes error "str has no properties"
...
}

Thanks,
Pete
_______________________________________________
Project_owners mailing list
Project_owners at mozdev.org
http://mozdev.org/mailman/listinfo/project_owners




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20070705/55c90474/attachment.html 


More information about the Project_owners mailing list