Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-20-2010, 10:05 PM   PM User | #1
Deroba
New to the CF scene

 
Join Date: Dec 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Deroba is an unknown quantity at this point
Exclamation Not loading the content from an external server

Ok, so this is the url http://air.deroba.org/do.php?vid=SR6iYWJxHqs -> Works and sends the info fine.

Now here is the code running main server:

Code:
<script type="text/javascript">
function DownloadAndConvert(f)
{
//document.getElementById("process").style.display = "block";
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) {
	if(xmlhttp.status==200) {	
		document.getElementById("received-content").innerHTML="CORRECT";
 *   } else { 
		document.getElementById("received-content").innerHTML="FAILED";
	 }
	}
  }
xmlhttp.open("GET", "air.deroba.org/do.php?vid=" + f.vid.value, true);
xmlhttp.send();
}
</script>
Code:
<div id="content"><div id="content-body">
<center>
<form name="input" method="get" onsubmit="return DownloadAndConvert(this);">
YouTube Video ID <input type="text" name="vid" id="vid" /><br />
<input type="submit" value="Comenzar!" />
</form><br /><br />
<div id="process" style="display:none;"><img src="http://deroba.org/img/loading.gif" /></div>
<div id="received-content">
Content should change
</div>
</center>
</div>
Any ideas why it will always show FAILED and then reload website?

Thanks
Deroba is offline   Reply With Quote
Old 12-20-2010, 10:26 PM   PM User | #2
Deroba
New to the CF scene

 
Join Date: Dec 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Deroba is an unknown quantity at this point
Just to add, the content is received correctly(I used wireshark). But the browser won't show it.

Maybe because i has spaces?
Deroba is offline   Reply With Quote
Old 12-20-2010, 10:31 PM   PM User | #3
Deroba
New to the CF scene

 
Join Date: Dec 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Deroba is an unknown quantity at this point
Nope, I changed the whole output of the php code to just be HOLA(hello in spanish) didn't work either.

What am I doing wrong here!
Deroba is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:42 AM.


Advertisement
Log in to turn off these ads.