这是jQuery的:的Javascript更换不起作用
<script type="text/javascript">
$(document).ready(function(){
var relName;
$('.child').each(function() {
relName = $(this).attr('rel');
relName.replace('&','');
$(this).attr('rel', relName);
$(this).appendTo('#' + $(this).attr('rel'));
});
});
</script>
有了这个有关HTML:
<div rel="MadDogs&EnglishmenHandpaintedfigurines" id="Figurines" class="category section child">
<h3 class="categoryTitle">Figurines</h3>
</div>
但由于某些原因,替换已经没有任何效果!
我不知道这是否是你的整个问题,但'&'需要在HTML中为'&'。 – Brad