I am trying to get a certain stylesheet from the head using javascript/jQuery.
I do not want to use $('head').get(0).innerHTML or similar cause the head is filled up with more than 30 script and link elements.
I tried this so far
// that's the one
var $my_stylesheet = $(document.body.previousSibling).find('link:last');
//those did not work (result: "")
$my_stylesheet.get(0).innerHTML;
$my_stylesheet.text();
$my_stylesheet.html();
What can i do to get the stylesheet content from the head?
Try to request via ajax call:
Code: http://jsfiddle.net/kh2en/1/