greencode

msg:4512203 | 10:31 am on Oct 25, 2012 (gmt 0) |
Ah ha, figured it out…
<script type="text/javascript"> var selectedScheme = 'Default'; $(document).ready(function() { $('#color_scheme').change(function(){ $('span').removeClass(selectedScheme).addClass($(this).val()); selectedScheme = $(this).val(); }); }); </script>
|
JAB Creations

msg:4512388 | 7:30 pm on Oct 25, 2012 (gmt 0) |
Yeah, don't use jQuery or any other frameworks, you'll rob yourself of learning anything meaningful, bloat the browser, unintentionally gimp the DOM with innerHTML which you should never ever use and introduce so many problems you'll be stuck in an infinite loop of suck. Also there is no such mime as "text/javascript" though it is required for IE8 and older and Opera 8.x (but not 7.x/older or 9.x/newer) for those browsers to correctly execute scripts. Once you've used DOM object detection have the server serve application/javascript for compliant browsers and text/javascript if you plan on supporting legacy browsers. - John
|
incrediBILL

msg:4514416 | 11:09 pm on Oct 31, 2012 (gmt 0) |
| don't use jQuery or any other frameworks, you'll rob yourself of learning anything meaningful |
| Nonsense. I'm all in favor of everyone learning the basics but there's no reason to not use code libraries instead of reinventing the wheel. Sorry, but I'm a long time programmer and telling people not to use libraries and templates, leveraging existing work to speed up the process, is bad advice. Plus using jQuery helps the site owner find other people that can help maintain the site for less expense because many use jQuery and it's less expensive to maintain than having to learn someone's unique code from scratch.
|
|