次のようなPHPページがあります。
<?php
class CallsClass {
var $conn1;
var $dataTable = "";
function calls() {
$this->conn1 = new Datasource("taylor", "dbproj", "root", "elves") or die("Could not connect");
$s1 = "SELECT id, UPPER(SUBSTRING_INDEX(fullname,' ',1)) as fullname, oldcode FROM `researcher` WHERE `display` = '1' AND fullname <> 'Jenny Porteous' AND fullname <> 'Carey-Lee Lendrum' AND fullname <> 'Carys Gibson'";
$result = $this->conn1->_execute($s1);
while ($row = $this->conn1->_nextAssocRow($result)) {
$fullName = $row['fullname'];
$dataTable .= $fullName;
}
echo json_encode($dataTable);
}
}
?>
I know want to call this with my Ajax function:
$(document).ready(function() {
$(function ()
{
$.ajax({
url: 'Queries/CallsQuery.php/calls',
dataType: 'json',
success: function(result)
{
//console.log(result);
}
});
});
Google Chrome開発ツールで「OPTIONSfile:/// C:/Users/wesley/Desktop/Highcharts%20example/Queries/CallsQuery.php/calls()リソースを読み込めませんでした」というエラーが表示されます。理由は何ですか。
ありがとう、ウェズリー