On Jul 1, 2010, at 1:40 AM, Edward Lynn wrote: > These approaches feel a bit hacky to me. It might be an idea to review why > you are using inline JS as it really shouldn't be necessary in most cases. > There are plenty of ways of triggered JS early on elements if that is the > reason of putting it inline. What are the times you find the js needs to be > inline? >
It's not me who wants to use inline JS, quote myself: " Magento that uses inline script heavily". :-) The system is not like WordPress that consists of a handful of php files, and because of its features, I personally think inline JS (sometimes even inline CSS) is the best possible approach available. They are placed in the template files, depending on the setup a store has, not all templates files are used, when a feature is not used and that feature requires JS, the JS shouldn't be called is it not a better approach? Strictly speaking, I wouldn't called them inline JS as they are for DOM event trigger, but I maybe wrong, as my javascript starts from jQuery beginner and ends at jQuery beginner. For a system that bundled with many features and heavily relies on javascript, yet the developer (developers as the Magento creators) have no idea how the system will be used, and what features are to be used or be excluded by the website owner, how do you propose an approach that is ideal for ivory towel's mentality and at the same time, fully satisfies real life practise? Actually I think it's not just for the Magento, but many more versatile CMS that inline CSS and JS have their rightful place, because content driven dynamic sites are no longer limited to PHP Include and content area (think WordPress post in the admin). If you are familiar with WordPress, you probably know Custom Fields. System that I know of such as Magento, Modx and Concrete5 are more powerful in handling similar (Custom Fields) feature which allow end user to insert script and markup such as SSL seal, payment badge, regularly updated content, third party snippet. A dynamic website is not an end-here journey, website owner will constantly using it, update it, maintain it. I fail to see having inline CSS and inline JS break the "separation of presentation and content" as far as the "constant journey" is concerned. From the maintenance point of view and to upholding the layout integrity, it's probably a much better idea to have website owners mess around within the Custom Field (chunk , block, static block, template variable however you call it) than allowing them to mess with the template and CSS files. I do not used inline CSS in my work, but do not see no reason why it cannot be used. At the end of the day, no body gets hurt, no visitor would have a traumatic user experience as a result, site is functioning, usable and accessible, and I get a good sleep knowing that the themes, the sites I built can withstand a little abuse of inline CSS and JS by the site owners. tee ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [email protected] *******************************************************************
