如何使用 jquery 将一些内容添加到应答器 HEAD 中?
我想在网络文档的头部动态插入一些 HTML 应答器。我尝试添加:
$("head").append("<style type=\"text/css\"> @import \"http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/claroGrid.css\";.container { text-align: center; margin: 10px; } .info { margin: 10px; }</style>");
但看起来不起作用...
您知道是否可以在头部应答器中动态添加一些内容?
非常感谢你,
蝙蝠
I'd like to insert dynamiccaly some balises of HTML in the head of the web document. I've tried to add :
$("head").append("<style type=\"text/css\"> @import \"http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/claroGrid.css\";.container { text-align: center; margin: 10px; } .info { margin: 10px; }</style>");
But it looks like it doesn't work...
Do you know if it's possible to add dynamiccaly some content in the head balise?
Thank you very much,
Bat
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您的问题可能是您缺少导入网址周围的
url()
位。您也不需要 url 周围的引号。请参阅此参考: http://htmlhelp.com/reference/css/style-html .html#importing尝试将其更改为:
I think your problem might be that you are missing the
url()
bit around your import url. You also do not need the quotes around the url. See this reference: http://htmlhelp.com/reference/css/style-html.html#importingTry changing it to: