Insert a Div from another page

0

I'm trying to get a DIV from this page .

The DIV is named .similar-artists . I want to play in DIV called #rock , but nothing works. Below the code:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><script>$(document).ready(function(){$("#rock").load("http://pipocaplayfm.com/artist/5216/Calvin+Harris .similar-artists ");
	
	 });
	
</script>

</head>
<body>
 
<div id="rock">
	
</div>
   
  </body>
</html>
    
asked by anonymous 25.09.2017 / 21:20

1 answer

1

Try this way ..

$.ajax({
    url: 'http://pipocaplayfm.com/artist/5216/Calvin+Harris',
    success: function(res){
                        $(res.responseText).find('.similar-artists')each(function(){
            $('#app').append($(this).html())
        
        });
    }
})
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
    <div id="app"></div>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
    
</body>
</html>
    
26.09.2017 / 15:46