惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
小众软件
小众软件
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
Jina AI
Jina AI
博客园 - 【当耐特】
V
Visual Studio Blog
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
量子位
IT之家
IT之家
G
Google Developers Blog
V
V2EX
The GitHub Blog
The GitHub Blog
月光博客
月光博客
GbyAI
GbyAI

博客园 - bestcomy

在OPENSUE 11.3 上安装 sysstat Upload bug in MOSS 2007 / Windows Server 2008 - bestcomy Excel列名转换 Clienside ProgressIndicator - bestcomy - 博客园 ASP.NET MVC 源代码发布! 微软项目组招聘.NET开发人员(北京) 欢迎访问我的新BLOG空间 SharePoint 胡言乱语 你觉得vs.net那些地方让你使用起来很不爽? Two ways to get HtmlTextWriter for HTML rendering How to set value for webpart’s properties when I create a new sharepoint template Get the true value of a calculate field in SharePoint 调用自定义event时需要注意的一个问题 self==top 如何设置AD用户的"用户下次登陆时须更改密码"属性 (LDAP Provider) 微软 and 香烟 Cool!!! Virtual Earth Technology Preview sth about our coding life 还没有Windows Live Messenger的朋友看过来
Include javascript and css dynamically - bestcomy
bestcomy · 2006-11-03 · via 博客园 - bestcomy

Some script I must post here in case of my bad memory. Maybe useful for my blog visitors.

 1 var getHead = function() {
 2                 return document.getElementsByTagName("head")[0];
 3             };
 4             var includeJavascriptFile = function(url) {
 5                 if (document.body == null) {
 6                     document.write("<script src='" + url + "' type='text/javascript'></script>");
 7                 } else {
 8                     var script = document.createElement("script");
 9                     script.type = "text/javascript";
10                     script.language = "JavaScript";
11                     script.src = url;
12                     getHead().appendChild(script);
13                 }
14             };
15             var includeCssFile = function(url) {
16                 if (document.body == null) {
17                     document.write("<link rel='stylesheet' href='" + url + "' type='text/css'/>");
18                 } else {
19                     var link = document.createElement("link");
20                     link.setAttribute("rel""stylesheet");
21                     link.setAttribute("type""text/css");
22                     link.setAttribute("href", url);
23                     getHead().appendChild(link);
24                 }
25             }