Insert stuff after a comment
HTML
<script>
</script>
<!-- Related css to this page -->
Here is some more stuff
JavaScript
$(function() {
$("body").contents().filter(function() {
return this.nodeType == 8;
}).each(function(i, e) {
if ($.trim(e.nodeValue) == "Related css to this page") {
$('<link/>', {
rel: 'stylesheet',
href: "bla.css"
}).insertAfter(e);
alert(document.body.innerHTML)
return false; // remove if href url is an array for example
}
});
});