Code: Select all
<script type="text/javascript">
function checkurl(str)
{
if (str=="")
{
document.getElementById("txtUrlHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtUrlHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","urlcheck.php?q="+str,true);
xmlhttp.send();
}
</script>
<input type='text' name='url' onchange=\"checkurl(this.value)\"><br/>Code: Select all
<?php
$q=$_GET["q"];
if ($q != NULL) { echo $q;}
?>But if I just enter a YouTube embedded code, ie this:
[text]<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/U6mm8W4ej2c?fs ... ram><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/U6mm8W4ej2c?fs=1&hl=en_GB" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>[/text]
It doesn't work. I was expecting it to display the video on the right.
Does anyone know why it won't do it?
IN ADDITION TO THIS....How do you work with Ajax on a Hyperlink?
So if I wanted to have the <object> appear on the right of the page by posting it thru Ajax to a video.php page, and it just appears?
Onchange works via a form field. How do you do it through A HREF??