1

jquery が Opera と 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>
4

2 に答える 2

1

これを試してみてください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'));
   });
});
于 2013-02-15T09:06:00.647 に答える
0

試す:

<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>
于 2013-02-15T09:01:28.933 に答える