日期:2014-05-16 浏览次数:20399 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <script type="text/javascript"> var head = document.getElementsByTagName('head')[0]; //方法一:动态创建并添加节点 var obj = document.createElement('script'); obj.type = 'text/javascript'; obj.src = 'http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js'; head.appendChild(obj); //方法二:修改head对象的innerHTML var str = '<link rel="stylesheet" href="http://static.jquery.com/files/rocker/css/reset.css" type="text/css" />'; head.innerHTML += str; </script> </body> </html>