A week or so ago, I really started to use JQuery on larger scale applications. Below are some of the things I ran in to. Hopefully this will help you in your JQuery projects.
- Say no to DataLists. The reason being that they wrap the div tags in unnecessary tables. Using a repeater instead produces cleaner code. Easier to debug your jquery
- No spaces un xslt attributes or elements
- Intellisense: http://blogs.ipona.com/james/archive/2009/01/14/jquery-1.3-and-visual-studio-2008-intellisense.aspx
- Use Firebug to watch expressions
- Do not put the minus sign in the id, name or class attributes as running an eval statement will fail. eg. the following will fail
$('#' + form + ' input, #' + form + ' textarea').each(function(i) { eval("msg." + $(this).attr('name') + " = '" + $(this).val() + "';"); }); - Try to keep functionality separated into different .js files instead of grouping them all in one. It makes it easier to debug.
No comments:
Post a Comment