Insert code snippet to div - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:text

Description

Insert code snippet to div

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
  <script type="text/javascript">
$(function(){//  www. j av  a 2 s  . c o m
    $.get("https://api.github.com/gists/3010111", function(response) {
        $(".result").text(response.data.files["new.html.erb"].content);
    },"jsonp");
});

      </script> 
 </head> 
 <body> 
  <pre class="result"></pre>  
 </body>
</html>

Related Tutorials