Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just to add, the content is received correctly(I used wireshark). But the browser won't show it.

    Maybe because i has spaces?

  • #3
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •