Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery CSS appending with no effect
- $('body').append('<style type="text/css"> body {background:red;} </style>');
- edit : function(page) {
- $.ajax({
- data : {
- 'edit' : page
- },
- success : function(i){
- var html = jQuery.parseJSON(i);
- $('#editPageListContainer, #editPreview').remove();
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.text = html.js;
- document.body.appendChild(script);
- $('body').append('<style type="text.css">' + html.css + '</style>' + html.php);
- }
- });
- }
- $('body').css('background', 'red');
- $("head").append("<style> body {background:red;}</style>");
- $.ajax({
- url: "url",
- async:false,
- success: function(css) {
- $("head").append("<style>"+css+"</style>");
- }
- });
- $('body').attr('style', 'background:red');
Add Comment
Please, Sign In to add comment