方法1:
var script = document.createElement("script")
script.type = "text/javascript"
script.src = "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
document.body.appendChild(script)
方法2:
var script = document.createElement("script")
script.type = "text/javascript"
script.src = "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
script.onload = function(){console.log("jQuery is ready!")}
document.body.appendChild(script)
cnblogs.com页面定制css本例:
div > a > span {
color: skyblue;
}
div > a > span:hover {
color: #ff0055;
}
.day:hover {
border: 1px solid orange;
}
.day:hover .postSeparator {
border-top: 1px dashed #ff0055;
}
/**************************下面的css用于去掉页面的多余元素 ***********************************/
/*去掉广告等 */
.c_ad_block {
display: none;
}
#ad_t2, #under_post_news, #under_post_kb, #footer, #navigator, #top_nav {
display: none;
}
/* 去掉点赞等 */
#author_profile, #div_digg {
display: none;
}
/* 去掉底部空栏 */
#blog-comments-placeholder {
display: none;
}
/**************************上面的css用于去掉页面的多余元素 ********************************/
/* 页脚 */
#page_end_html {
text-align: center;
min-height: 15px;
margin: 15px 0;
font-size: 15px;
color: #c4d7d6;
}
/* 移动好文要顶位置 */
#green_channel {
margin-left: 50%;
margin-bottom: -60px;
border: #d452ff 1px dashed;
border-top: none;
}