ajax - Removing javascript created content -
I have some JavaScript that works behind a navigation menu, the user clicks the NAV button, and some AJAX ignites and brings in some HTML, which I want to do if that link is clicked again, the content written by that particular button is removed from the markup.
Does anybody have ideas? My code is currently at
$ ("# blog"). Click (function (ev) {ev.preventDefault () var url = $ (this) .attr ("href"); $ .ajax ({url: "index.php / home / category", type: "GET" , Success: function (html) {// alert ("success"); $ ("#ordion"). Append (html);}}};});
$ ("# accordion"). Attachments ($ ("& lt; Div class = 'ajexontend' / & gt;" .append (html));
And then you can easily do $ ('.jaxcontend'). Remove ();
.
One other option is to $ ('#Adordian: last-child'). Remove ();
, but this is a little hack.
Comments
Post a Comment