Grab emails from URL?

Grab emails from URL?

Hi guys

I'm trying to grab emails from URL and display.
  1.     <script type="text/javascript">
  2.         $(document).ready(function () {
  3.            $("#submit").click(function () {
  4.                 var curUrl = $("#url").val();
  5.                 
  6.                 function extractEmails(curUrl)
  7.                 {
  8.                     return curUrl.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);
  9.                 }    
  10.         
  11.                 document.getElementById('result').innerHTML = curUrl;
  12.                 
  13.                 //Grab URL 
  14.                 //Grab Emails RegEx
  15.                 //Output Emails to screen with counter
  16.                 //Save to database
  17.                 $( "body" ).load( curURL ).text(extractEmails(curUrl).join('\n'));
  18.                 
  19.             });
  20.         }); 
  21.     </script>
Here are my codes


But it doesn't display the emails?
What are my mistakes here?
How to fix this?

thanks in advance.