0

ライブラリ Yotube API PHP (ビデオの検索) を zend.com とそのサンプルからダウンロードしました。Windows(localhost)ではすべて正常に動作します... debianサーバーにアップロードすると、リクエスト検索ビデオでエラーが発生します:

Invalid response received - Status: 404

videoO-browser.js からのこのエラーのコード

/**
 * 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);
}

悪い英語、ごめんなさい

4

1 に答える 1

1

どうやら、リクエスト文字列が何らかの形で間違って送信されているようです (エラー 404 = リソースが見つかりません)。デバッグ用のエコーと適切な場所を使用して、ローカル コピーとサーバー コピーの違いを正確に確認したいと考えています。

于 2010-02-18T19:07:02.143 に答える