> Just a question/thought on the complete deprecation of
> jQuery.browser.... I know the new model is to go toward a
> "supportsXXXX" type declarative syntax for testing of support. And I
> agree with that approach... in theory.
>
> But what about frustrating browser differences that are just that --
> browser differences, and not really "supports" of any thing,
> especially not javascript related specifically.
>
> For instance, I have some jQuery code that breaks up long text/URL's
> by inserting word-breaks to allow for more normal line breaking/
> wrapping.  Thanks to quirksmode.org, it is seen that for most
> browsers, the <wbr> tag is the one to use for such a feat.  But for
> safari, the &shy; is better (since <wbr> is only supported once on a
> "line" by safari).
>
> So, I have a line of jQuery code testing 'jQuery.browser.safari' to
> decide which "break character/entity" to use.  So, my question is, how
> on earth would I do this with the new syntax and wean myself off the
> deprecated syntax?  It's not even a javascript thing.  It's just a
> browser/rendering support thing.  But with no direct way to know what
> browser I'm in, how will I accomplish it?
>
> I guess somehow I'd need to create a "supportsWBR" or something like
> that?

Correct - without thinking about the problem too much I'd make a div
with a short width (say 10px) and set its innerHTML =
"somelong<wbr>wordoverhere" (something that would obviously break) -
and then compute the height. If the height is tall then I know that
the wbr worked, otherwise I know that it didn't. Could do a similar
test for &shy;

If you look at most of the things listed in jQuery.supports they're
simply testing to make sure that a browser feature doesn't have a
specific bug - not really that glamorous.

--John

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to