Re: Detecting inherited language

On 10/07/2013 10:47 , Tobie Langel wrote:
> On Wednesday, July 10, 2013 at 10:38 AM, Richard Ishida wrote:
>> Can anyone tell me whether there's a way to detect the inherited
>> language of an element, other than by recursing up the tree looking
>> for lang attributes? (I'm looking for something like
>> computedvalue.)
>
> What's wrong with the recursive approach? You can always wrap it up
> in a little helper/assertion function.

You need more than to recurse, you also need to look at the <meta> and 
at the end you need to XHR your own location and look at 
Content-Language. It's all doable, but a bit cumbersome.

And Richard, I forget when this came up, but the conclusion last time 
around was that this information was unfortunately not exposed in the 
DOM so you indeed have to get it yourself.

-- 
Robin Berjon - http://berjon.com/ - @robinberjon

Received on Wednesday, 10 July 2013 09:04:26 UTC