I’m trying to create a CSS class with the following:
var not_cursor = $('<style>#NOT_CURSOR { CURSOR: NONE; BACKGROUND: URL("images/NOT1.png") NO-REPEAT LEFT TOP;
POSITION: ABSOLUTE;
DISPLAY: NONE;
TOP: 0;
LEFT: 0;
Z-INDEX: 10000;}</style>');
$('html > head').append(not_cursor);
And then in another file I try accessing $(‘#NOT_CURSOR’) but I get an error –
Uncaught SyntaxError: Unexpected token ILLEGAL
And it’s telling me this occurs on line 1. Any help?
Thanks.
Try keeping it all on one line or concatening the separate line chunks.
jsFiddle example.
OR, use the multi-line escape trick: jsFiddle example.