我想添加一个在Ajax调用中指定的外部样式表.
我已经找到了一种方法来使用jQuery(参见下面的示例),但是我需要使该方法适应dojo JavaScript框架.
JQuery示例
$('head').append('<link rel="stylesheet" type="text/css" href="lightbox_stylesheet.css">');
谢谢.
解决方法:
一旦你包含dojo.NodeList-manipulate
,它几乎与jQuery相同:
dojo.require("dojo.NodeList-manipulate");
dojo.ready(function(){
dojo.query("head").append('<link rel="stylesheet" type="text/css" href="lightbox_stylesheet.css">');
});