谁能解释为什么这个 jsfiddle 在 chrome 中不起作用,但在 Firefox 中却完美无缺?
这是链接:http: //jsfiddle.net/Bu33n/
这是以防 jsfiddle 无法访问的代码:
<div class="container">
<div class="scheduleSet" id="remove19s">
<p>I am a schedule19</p>
</div>
<div class="scheduleSet" id="remove5s">
<p>I am a schedule5</p>
</div>
<div class="phoneSet" id="remove19p">
<p>I am a phone19</p>
</div>
<div class="phoneSet" id="remove5p">
<p>I am a phone5</p>
</div>
<a href="javascript:void(0);" onclick="Location.removeMe('remove19p');">Remove me</a>
<a href="javascript:void(0);" onclick="Location.addMe();">Add me</a>
</div>
JS:
Location.removeMe = function (data) {
var stuff = "";
stuff = data;
$('div').remove('#' + stuff);
return false;
};
Location.addMe = function () {
$('.container').append("<div class='phoneSet' id='remove19p'>" +
"<p>I am a replacement phone19</p>" +
"</div>");
}