Skip to content Skip to sidebar Skip to footer

Chrome Not Working With Jquery Remove

Can anyone explain why this jsfiddle does not work in chrome, but works flawlessly in Firefox? here's the link: http://jsfiddle.net/Bu33n/ Here's the code just in case jsfiddle is

Solution 1:

Rather than Google Chrome not working here, what's happening is that Firefox is overlooking your undefined Location namespace for some reason. Make sure you've defined it and your functions belong to it, or just use your functions this way (which seems more appropiate for your situation):

functionremoveMe(data) { ... }
functionaddMe() { ... }

And in the onclick attributes of your links, onclick="removeMe('remove19p'); return false;" and onclick="addMe(); return false;" respectively.

Solution 2:

You need to assign a new Object to Location for it to work in Chrome

Location = new Object();

Solution 3:

try this :

functionremoveMe(data) {
        $('div').remove('#' + data);
        returnfalse;
    };
    functionaddMe() {
        $('.container').append("<div class='phoneSet' id='remove19p'>" +
            "<p>I am a replacement phone19</p>" +
            "</div>");
    }

AND HTML :

<ahref="javascript:void(0);"onclick="removeMe('remove19p');">Remove me</a><ahref="javascript:void(0);"onclick="addMe();">Add me</a>

Post a Comment for "Chrome Not Working With Jquery Remove"