corporate win--their requirements

Christopher A. Aillon caillon at returnzero.com
Sat Sep 28 05:18:09 UTC 2002


David Miller wrote:
> Ah, yeah, but then it always depends on the user having Javascript
> anyway...  not to mention we wind up having to find creative ways to name
> and display the time elements so the Javascript can alter them.  (Can you
> access the .text property of a <span>?)

JS is generally used for enhancing a site.  If a user doesn't want it on, that's 
fine, they can use Bugzilla without it without any loss of functionality.  This 
is an enhancement though and the people that typically care about this sort of 
thing are end users who do have JS on.  This is a client related thing and we 
shouldn't do client things on the server side.  Plus I bet there is some 
interest in keeping the DB size down.

Anyway, get a reference to the span element and there are various ways to get at 
its text.  Probably using .innerText or .innerHTML is the easiest.  Though 
non-standardized, it's an extension that MS and we support.  If you want it to 
use DOM standards, then use spanElt.childNodes[0].nodeValue.  You don't need to 
be all that creative for times.

<span name="foo">January 1, 1970 23:00</span>

var dates = document.getElementsByName("foo");

Then just iterate through the dates nodeList.  So long as you make sure you 
don't assign name="foo" to anything else other than a date, you're fine.




More information about the developers mailing list