Javascript 具有多个输入选项的Datatable

Javascript 具有多个输入选项的Datatable,javascript,php,html,datatable,datatables,Javascript,Php,Html,Datatable,Datatables,我的目标是:我想使用带有多个过滤选项的datatable。为此,所有文件都应该彼此分离(意味着有一个html、js、php文件)并从数据库中读取。但是,使用js中的当前代码,我得到了错误消息: ReferenceError:$未定义 我是这方面的新手,有人能为我的应用找到合适的手册吗?互联网上的一切都被编码成一到两个文件。我也使用smarty 我的文件: test.php <?php require_once './Smarty/libs/Smarty.class.php'; echo "

我的目标是:我想使用带有多个过滤选项的datatable。为此,所有文件都应该彼此分离(意味着有一个html、js、php文件)并从数据库中读取。但是,使用js中的当前代码,我得到了错误消息:
ReferenceError:$未定义

我是这方面的新手,有人能为我的应用找到合适的手册吗?互联网上的一切都被编码成一到两个文件。我也使用smarty

我的文件:

test.php

<?php
require_once './Smarty/libs/Smarty.class.php';
echo "<script src=\"javascripts/test.js?v=3\" type=\"text/javascript\"></script>";
echo "<script src=\"javascripts/jquery.js?v=3\" type=\"text/javascript\"></script>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css\">";

$smarty = new Smarty();

$smarty->display('test.tpl');
test.tpl

<main class="content">
    <table id="datatables-table" class="table table-striped table-hover" style="width:100%"></table>
</main>

testHelper.php

<?php
if($_REQUEST['action'] == "listmovies"){
    $data = array();


    $value['test1'] = utf8_encode("test1");
    $value['test1'] = utf8_encode("test1");
    $data[] = $value;

    $value2['test2'] = utf8_encode("test2");
    $value2['test2'] = utf8_encode("test2");
    $data[] = $value2;

    $return['data'] = $data;
    echo json_encode($return);
}

在html文件中包含jquery,但这没有什么区别```在html文件中包含jquery,但这没有什么区别```
<?php
if($_REQUEST['action'] == "listmovies"){
    $data = array();


    $value['test1'] = utf8_encode("test1");
    $value['test1'] = utf8_encode("test1");
    $data[] = $value;

    $value2['test2'] = utf8_encode("test2");
    $value2['test2'] = utf8_encode("test2");
    $data[] = $value2;

    $return['data'] = $data;
    echo json_encode($return);
}