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);}}};});  
< P>
  $ ("# 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

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -