How print AJAX data?
<p>Thanks to people from stackoverflow, they helped me to realize my functional with Ajax, but now I have another problem. Below is code:
    

<pre><code>if(isset($_POST['site'])){
if($_POST['site'] == NULL)
{
echo "Field cannot be empty";
return;
}

//here we check site validation on server side 
if (!preg_match("~^(?:(?:https?|ftp|telnet)://(?:[a-z0-9_-]{1,32}".
"(?::[a-z0-9_-]{1,32})?@)?)?(?:(?:[a-z0-9-]{1,128}\.)+(?:com|net|".
"org|mil|edu|arpa|gov|biz|info|aero|inc|name|[a-z]{2})|(?!0)(?:(?".
"!0[^.]|255)[0-9]{1,3}\.){3}(?!0|255)[0-9]{1,3})(?:/[a-z0-9.,_@%&amp;".
"?+=\~/-]*)?(?:#[^ '\"&amp;&lt;&gt;]*)?$~i", $_POST['site']))
{
echo "&lt;br/&gt;";
echo "&lt;div id='err'&gt;Oooops!!! Wrong site name&lt;/div&gt;";
return;
} 

$homepage = file_get_contents("http://".$_POST['site']);
preg_match('%&lt;meta.*name="keywords".*content="(.*)"\s+/&gt;%U', $homepage, $regs);



if(count($regs))
 {
$myString = implode( '', $regs );  
 echo "&lt;br/&gt;";
 echo "&lt;div id='test'&gt;Keywords:&lt;/div&gt;";
 print_r( "&lt;div id='test2'&gt;$myString&lt;/div&gt;");
}
else
{
echo "&lt;br/&gt;";
echo "&lt;div id='test'&gt;There is no keywords&lt;/div&gt;";
}
}


?&gt;
&lt;html&gt;

&lt;head&gt;
&lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;    
&lt;script type="text/javascript"&gt;
$(document).ready(function(){
     $('#payment').submit(function(e){
        e.preventDefault();
        var x = $('input[name=site]').val();

       $.ajax({
             type: "POST",
            url: 'test.php',
            //data: $(this).serialize(),
            data: x,
            datatype: 'json',
            success: function(data)
            {
                 $('#metaTags').text(data)
            },
             error:   function(xhr, ajaxOptions, thrownError) { alert(xhr.status);} 

        });
    });
});
&lt;/script&gt;


&lt;/head&gt;     

&lt;div&gt;
&lt;form id="payment"    method="post" name="forma1"&gt;
    &lt;label for=name&gt;ENTER www.bbc.com:&lt;/label&gt;
    &lt;input id="name" type=text placeholder="Write here..."         name="site"&gt;
    &lt;input type="submit" value="START" name="searchbutton" id="sb"&gt;
&lt;/form&gt;

&lt;div id="metaTags"&gt;&lt;/div&gt;

&lt;/div&gt;  


&lt;/html&gt; 
</code></pre>

<p>Everything is ok, but the output you can see here:
<a href="http://tsite.500mb.net/test.php" rel="nofollow">http://tsite.500mb.net/test.php</a>
for testing type for example: www.bbc.com and you'll see the output result
I need that the otput will  only meta tags, without source code. How to do it?
I tried next idea:</p>

<pre><code>var x = $('input[name=site]').val();
 $.ajax({
             type: "POST",
            url: 'test.php',
    data: x,
</code></pre>

<p>where data = x, and x - value from input textbox, but it doesn't help. Any ideas?</p>
