[LEFT][COLOR=#333333][FONT=Arial]I am working on a jQuery plugin and I would like some opinions from more experienced people about good practices of integrating the HTML, CSS and JavaScript code.
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]Specifically:
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]1.HTML code - static vs dynamic
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]Is it good to write only the bare minimum of HTML markup and dynamically create the rest of the needed HTML code through JavaScript, in the plugin ?
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]Or is it better to just manually write all of the needed HTML ?
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]Only the minimum HTML looks cleaner and easier to modify but all of the required HTML might be better to fully understand, customize and work with the plugin, as you see the entire structure of the code.
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]2.CSS code - in JavaScript or external
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]Is it good to create and apply the CSS code dynamically, in JavaScript, or have the CSS code external, in a CSS file ?
[/FONT][/COLOR]
[COLOR=#333333][FONT=arial]My initial thought was for all of the settings to be controlled from the plugin settings, thus having all of the necessary customization options in one place, rather than having some options in the plugin settings and having to edit the CSS file for others (applicable in a not so big plugin).
[/FONT][/COLOR]
[COLOR=#333333][FONT=arial]But this option does not seem as good for bigger plugins where there would potentially be a lot of CSS. [/FONT][FONT=Arial]If the CSS is external, the user needs to edit the CSS file in order to modify the different options available.
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]On the one side, having minimal HTML and dynamically created CSS seems easier for the user to understand, on the other, having all the HTML and external CSS seems more powerful and better for more advanced plugins.
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]What are your practices ? Are there any recommended best practices ?
[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]What I am looking for are some pointers from experienced users on good practices about integrating the HTML, CSS and JavaScript in creating a plugin.[/FONT][/COLOR]
[/LEFT]