Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- how to apply CSS styles in current document recieved from AJAX request?
- #id1{something:something}
- #id2{something:something}
- #id3{something:something}
- ...etc ect
- <link rel="stylesheet" type="text/css" href="..." />
- var url = "......"; // including parameters
- var script = $('<link>', {
- rel: 'stylesheet',
- type: 'text/css',
- href: url
- }).appendTo(document.head);
- var data = {id1: {something: something}, id2: {something: something}, id3: {}}
- $.each(data, function(index, item) {
- $('#' + index).css(item);
- });
- <div id="result"></div>
- $('head').append('<style> #result { background-color: orange; } </style>');
Advertisement
Add Comment
Please, Sign In to add comment