Has anyone had luck getting the contents of a stylesheet loaded with a tag?
A:
jQuery
var link = $('#linkID');
$.get(link.attr('href'), '', function(data) {
alert(data);
});
The fact that I am way too lazy to write the native JS way proves that you should use jQuery.
ChaosPandion
2009-10-04 05:15:04
Problem with this is that its doing a 2nd GET request to load the data. Already know how to do that. Thanks though.
Geuis
2009-10-04 06:27:28
+1
A:
If you want to get the content of already-loaded stylesheets without an additional HTTP request, the best place to start is the document.styleSheets
object. Here's documentation (from MDC, but IE's implementation is largely similar): https://developer.mozilla.org/En/DOM/document.styleSheets
eyelidlessness
2009-10-04 05:46:55