[jQuery] Re: ie8 and title text value

2010-01-08 Thread Šime Vidas
Well, maybe the guys at jQuery optimized the text method only for
elements that can appear more than once... I don't know.

However, text() should not be used for TITLE anyway, so this "bug" is
not a problem.


Re: [jQuery] Re: ie8 and title text value

2010-01-08 Thread graham

Šime,

$('title').html() works fine in both IE8 and FF, fixing my problem.

But I don't understand why the difference in behaviour on : 
surely if there's only one title element than the innerHTML of the first 
matched element should be the same as the concatenated innerHTML of all 
matched elements? But if I try to print $('title').text() in IE8, it 
prints an empty string.


In any case, you fixed my problem for me so thanks a lot!

Graham


Šime Vidas wrote:

The, html() method works in all browsers...

text() = returns the concatenated innerHTML properties of all matched
elements
html() = returns the innerHTML property of the first matched element

Generally you don't use text() to retreive the contents of an
element...

BUT, if you want to write to the innerHTML property, then ...

html("blablabla") = sets the innerHTML property to the given string on
every matched element
text("blablabla") = sets the innerHTML property to the given string on
every matched element, AND escapes < and >




[jQuery] Re: ie8 and title text value

2010-01-06 Thread Šime Vidas
The, html() method works in all browsers...

text() = returns the concatenated innerHTML properties of all matched
elements
html() = returns the innerHTML property of the first matched element

Generally you don't use text() to retreive the contents of an
element...

BUT, if you want to write to the innerHTML property, then ...

html("blablabla") = sets the innerHTML property to the given string on
every matched element
text("blablabla") = sets the innerHTML property to the given string on
every matched element, AND escapes < and >


[jQuery] Re: ie8 and title text value

2010-01-06 Thread Dave Methvin

I think document.title works on all browsers.