Html – inject html using ajax


I have a HAML page with some div elements. I need to inject this into a div on another page when a button is clicked. how do i do this? thanks

Best Solution

You have to add the jQuery plugin from you can download the plugin or use the link as src in the js file.

then use the follwing code

      url: "test.html",
      context: document.body,
      success: function(response){

Hope this helps!!! happy coding.