Reputation: 360
Why does the jquery not working in Opera and Chrome?
<script language="JavaScript">
$('link[href="includes/styles.css"]').attr("href", "includes/new_styles.css");
$('link[href="includes/jmesa/jmesa.css"]').attr("href", "includes/jmesa/new_jmesa.css");
</script>
Upvotes: 1
Views: 394
Reputation: 74738
Try this out in doc ready
: http://jsfiddle.net/YRC4N/
$(function(){
$('link[href$="styles.css"]').attr("href", "includes/new_styles.css");
$('link[href$="jmesa.css"]').attr("href", "includes/jmesa/new_jmesa.css");
$('link').each(function () {
console.log($(this).attr('href'));
});
});
Upvotes: 1
Reputation: 2796
Try:
<script language="JavaScript">
$('link[href*="includes/styles.css"]').attr("href", "includes/new_styles.css");
$('link[href*="includes/jmesa/jmesa.css"]').attr("href", "includes/jmesa/new_jmesa.css");
</script>
Upvotes: 0