<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel><title>Loveyuki&apos;s BLOG - Javascript 动态加载 CSS STYLE 元素</title><link>http://www.loveyuki.com/Comment/Index.aspxArticle/Javascript_Load_Style_Elements.aspx</link><language>zh-CN</language><webMaster>loveyuki@gmail.com</webMaster><pubDate>Sun, 21 Oct 2007 08:07:39 GMT</pubDate><copyright>Copyright 2007. All rights reserved.</copyright><generator>Bitrac，安全、轻巧、快速、易用的个人博客从此开始</generator><image><title>Loveyuki&apos;s BLOG</title><url>http://www.loveyuki.com/Images/banner.gif</url><link>http://www.loveyuki.com/</link></image><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_735</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>RainBlog</author><pubDate>Thu, 31 Jan 2008 14:43:36 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_735</guid><description><![CDATA[这种写法不科学,你认为OO么?而且很不灵活,不适合Ajax异步转载!轻微鄙视一下!<br />最好使用CSS外部导入法加载!functionAttachStyle(){]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_736</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>RainBlog</author><pubDate>Thu, 31 Jan 2008 14:44:14 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_736</guid><description><![CDATA[function AttachStyle(){<br />this.load=function(URL) { <br /> var css=document.createElement('link'); <br /> css.type=&quot;text/css&quot;; <br /> css.rel=&quot;=&quot;stylesheet&quot;; <br /> css.src=URL; <br /> var head=document.getElementsByTagName(&quot;head&quot;)[0]; <br /> head.appendChild(css); <br /> var self=this;<br /> css.onload=css.onreadystatechange=function(){<br /> if(this.readyState&amp;&amp;this.readyState==&quot;loading&quot;) return;<br /> self.onsuccess();<br /> }<br /> css.onerror=function(){<br /> head.removeChild();<br /> self.onfailure();<br /> }<br />}<br />this.onsuccess=function(){}//加载成功事件<br />this.onfailure=function(){}//加载失败事件<br />}]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_737</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>RainBlog</author><pubDate>Thu, 31 Jan 2008 14:46:11 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_737</guid><description><![CDATA[以上方法适合任何外部导入script link等等]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_738</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>RainBlog</author><pubDate>Thu, 31 Jan 2008 14:52:59 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_738</guid><description><![CDATA[css.rel=&quot;stylesheet&quot;; //貌似 30分钟内修改评论不能用?]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_739</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>Loveyuki</author><pubDate>Thu, 31 Jan 2008 15:09:49 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_739</guid><description><![CDATA[暂时不能用的。呵呵。解释型的语言不要太 OO。银蛋是不存在的。]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_745</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>RainBlog</author><pubDate>Fri, 01 Feb 2008 06:15:57 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_745</guid><description><![CDATA[解释型的语言不要太 OO??ajax里面javascript不仅仅再是添加表单验证或网页特效的脚本语言了,它已经被工程化了!]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_746</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>slleo</author><pubDate>Fri, 01 Feb 2008 07:30:34 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_746</guid><description><![CDATA[loveyuki重新开张了，贺一下。<br />先报告一个小BUG：http://www.loveyuki.comArticle/45/Feeds.ashx路径中少了一个/，所有的页面里的“引用通告”和“评论订阅”基本上都少这个，路径错了。]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_749</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>汤尼尔</author><pubDate>Fri, 01 Feb 2008 11:53:56 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_749</guid><description><![CDATA[css.src = &quot;&quot;; 最好用<br />另：预祝老哥春节快乐。]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_762</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>Crazy</author><pubDate>Sun, 03 Feb 2008 08:50:06 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_762</guid><description><![CDATA[应该考虑用现成的js框架了，现在有那么多好的框架]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_1354</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>wllllll</author><pubDate>Tue, 10 Jun 2008 06:25:27 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_1354</guid><description><![CDATA[一楼，这个东西怎么不适合ajax了呢，先下载数据，再用这个书写。<br />怎么会不适合ajax呢。真奇怪了。<br /><br />用js下载css，再用此函数书写css，不一样是ajax]]></description></item><item><link>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAnchor_3176</link><title>评论：Javascript 动态加载 CSS STYLE 元素</title><author>test</author><pubDate>Tue, 09 Jun 2009 04:52:23 GMT</pubDate><guid>http://www.loveyuki.com/Article/Javascript_Load_Style_Elements.aspx#CommentAuchor_3176</guid><description><![CDATA[link方式要求加载的xx.css已经存在
我现在就需要一个加载到当页&lt;style&gt;里面的方式，试了多次，没能找到对应的方法。多谢了。
不同的方式对应不同需求
至于不要太OO，我也不明白，但很不喜欢自以为是的搞这些名词。]]></description></item></channel>
</rss>