I am fairly sure that technically speaking, the <style> tag can only be in the <head> and not the body... (Some one please correct me if I am wrong!) For now I have been doing this as well as just having each modules CSS inline, but it doesnt display the CSS on IE Windows... After I posted my original question I found this online... function loadobjs(){ if (!document.getElementById) return for (i=0; i<arguments.length; i++){ var file=arguments[i] var fileref="" if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding if (file.indexOf(".js")!=-1){ //If object is a js file fileref=document.createElement('script') fileref.setAttribute("type","text/_javascript_"); fileref.setAttribute("src", file); } else if (file.indexOf(".css")!=-1){ //If object is a css file fileref=document.createElement("link") fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", file); } } if (fileref!=""){ document.getElementsByTagName("head").item(0).appendChild(fileref) loadedobjects+=file+" " //Remember this object as being already added to page } } } I haven't tested it yet, but this was the sort of thing I had in mind. Cheers. ______________________________________________________________________ Alex Duffield . Principal . InControl Solutions . http://www.incontrolsolutions.com On 15-Jun-06, at 9:19 AM, Tristan Kelley wrote: Maybe just have a seperate style sheet for each module? At the beginning of each code section you're calling just include your CSS link: |
_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs