2010-02-18 83 views
0

我从zend.com及其示例下载了库Yotube API PHP(搜索视频)。 (在Windows本地主机)一切正常Debian的服务器上的微细... 上传,并有在请求搜索视频提供了一个错误:从视频browser.js这个错误的Youtube API PHP问题

Invalid response received - Status: 404 

代码

/** 
* Sends an AJAX request to the server to retrieve a list of videos or 
* the video player/metadata. Sends the request to the specified filePath 
* on the same host, passing the specified params, and filling the specified 
* resultDivName with the resutls upon success. 
* @param {String} filePath The path to which the request should be sent 
* @param {String} params The URL encoded POST params 
* @param {String} resultDivName The name of the DIV used to hold the results 
*/ 
ytvbp.sendRequest = function(filePath, params, resultDivName) { 
    if (window.XMLHttpRequest) { 
    var xmlhr = new XMLHttpRequest(); 
    } else { 
    var xmlhr = new ActiveXObject('MSXML2.XMLHTTP.3.0'); 
    } 

    xmlhr.open('POST', filePath, true); 
    xmlhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 

    xmlhr.onreadystatechange = function() { 
    var resultDiv = document.getElementById(resultDivName); 
    if (xmlhr.readyState == 1) { 
     resultDiv.innerHTML = '<b>Loading...</b>'; 
    } else if (xmlhr.readyState == 4 && xmlhr.status == 200) { 
     if (xmlhr.responseText) { 
     resultDiv.innerHTML = xmlhr.responseText; 
     } 
    } else if (xmlhr.readyState == 4) { 
     alert('Invalid response received - Status: ' + xmlhr.status); 
    } 
    } 
    xmlhr.send(params); 
} 

的英语不好,对不起

+0

发布您的代码。 – 2010-02-18 19:07:35

回答

1

Apperently,您的请求字符串以某种方式传输错误(错误404 =没有找到的ressource)。你想通过使用回声调试和正确的地方来检查你的本地副本和服务器副本之间究竟有什么不同。