![]() | Fallback for new input types |
|
14 Jul 2010, 23:42
John Davalos (4 posts) |
Hello, I’m having an issue with the fallback for the new html5 input types. I’m following the example of page 50 using the hasColorSupport(). Firefox returns false, but safari, and chrome return true, but both Chrome and Safari don’t present the html5 color picker. i’ve tried this with the date picker as well, and i get the same results. Firefox will give me the jquery color picker, but Chrome and Safari don’t give me anything. any ideas why? Thanks, |
|
15 Jul 2010, 00:47
Brian P. Hogan (127 posts) |
New versions of Safari and Chrome now “support” the color picker but don’t actually IMPLEMENT a control, so the typical feature detection scripts just fail miserably. The current state of browser support for these fields is so messed up right now that this is the way the Modernizr library solves the issue: http://github.com/Modernizr/Modernizr/blob/mast… I may end up rewriting that section to use Modernizr, or at least the relevant code – I love the library itself but I want people to understand what they’re using. I hope that explains things a bit, and I’m sorry you ran into that problem. I’ll do what I can to make it right before print. Thanks for reading. |
|
15 Jul 2010, 04:40
John Davalos (4 posts) |
Hi Brian, Thanks for the response. That makes perfect sense. Seems that it’s the case for most of the new input types. Thanks for the tip! Do i just need the webforms(), or the entire script? I’m really enjoying the book so far. John |
|
15 Jul 2010, 12:18
Brian P. Hogan (127 posts) |
Well, unless you feel like picking that apart, you may just want to use the entire library. I am going to show you in the book how to handle the color field explicitly, and then recommend using Modernizr for production projects with the caveat that you investigate how it works so when new browsers break stuff you can hack the code yourself to get it to work. I don’t kno when those changes will make it to the beta book though – we have other things up first. |
| You must be logged in to comment |

