1

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

Ender
  • 14,995
  • 8
  • 36
  • 51
user376112
  • 859
  • 5
  • 15
  • 24

1 Answers1

0

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#importing

Try changing it to:

$("head").append('<style type="text/css"> @import url(http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/claroGrid.css); .container { text-align: center; margin: 10px; } .info { margin: 10px; }</style>');
Ender
  • 14,995
  • 8
  • 36
  • 51