Skip to content

Commit

Permalink
Apply stylesheets client-side in a safer manner.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromakode committed Sep 19, 2012
1 parent 5dba8a6 commit 7621afe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions r2/r2/public/static/js/jquery.reddit.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,10 @@ $.apply_stylesheet = function(cssText) {
* that has the old stylesheet, and delete it. Then we add a
* <style> with the new one */
$("head").children('*[title="' + sheet_title + '"]').remove();
$("head").append("<style type='text/css' media='screen' title='" +
sheet_title + "'>" + cssText + "</style>");
var stylesheet = $('<style type="text/css" media="screen"></style>')
.attr('title', sheet_title)
.text(cssText)
.appendTo('head')
}

};
Expand Down

0 comments on commit 7621afe

Please sign in to comment.