2010-02-18 84 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)。你想通過使用回聲調試和正確的地方來檢查你的本地副本和服務器副本之間究竟有什麼不同。