Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/371.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在本地javascript文件中使用CDN中的对象?_Javascript_Regression - Fatal编程技术网

如何在本地javascript文件中使用CDN中的对象?

如何在本地javascript文件中使用CDN中的对象?,javascript,regression,Javascript,Regression,我试图在本地javascript文件中使用regression.js。我正在使用CDN获取regression.js <script src='https://cdnjs.cloudflare.com/ajax/libs/regression/1.4.0/regression.min.js'></script> 然而,当我试图显示回归方程时,我得到了一个错误。我已经发现回归是一个函数,但我不知道为什么。当我使用cdn时,有人知道如何使用回归js方法吗 <head&

我试图在本地javascript文件中使用regression.js。我正在使用CDN获取regression.js

<script src='https://cdnjs.cloudflare.com/ajax/libs/regression/1.4.0/regression.min.js'></script>
然而,当我试图显示回归方程时,我得到了一个错误。我已经发现回归是一个函数,但我不知道为什么。当我使用cdn时,有人知道如何使用回归js方法吗

<head>
        <!--MetaData-->
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Security History</title>
        <!--Stylesheets-->
        <link rel='stylesheet' href='{% static "interface/common.css" %}' />
        <link rel='stylesheet' href='{% static "interface/edit_style.css" %}' />
        <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">-->
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
        <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
        <!--Scripts-->
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
        <!--<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.15.0/popper.min.js'></script>-->
        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
        <script src='https://cdnjs.cloudflare.com/ajax/libs/regression/1.4.0/regression.min.js'></script>
        <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
        <script src='{% static "interface/historyGraphing.js" %}'></script>
    </head>

安全历史

我对该库不熟悉,但它看起来好像希望您在web上像这样使用它:

let linearRegression=回归('linear',[0,1],[32,67],[12,79]);
console.log(线性回归)

你能用你的html和所有东西发布一个完整的设置吗?我不认为需要比头部更多,但是如果你需要更多,请询问谢谢!你在文档中的什么地方找到了这个?或者如果没有在文档中,那么在哪里?另外,你对回归分析库还有什么其他建议吗?@wilmoskal-我已经用更多信息更新了答案。我不能和回归分析库说话。这是一个我不熟悉的话题。
<head>
        <!--MetaData-->
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Security History</title>
        <!--Stylesheets-->
        <link rel='stylesheet' href='{% static "interface/common.css" %}' />
        <link rel='stylesheet' href='{% static "interface/edit_style.css" %}' />
        <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">-->
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
        <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
        <!--Scripts-->
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
        <!--<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.15.0/popper.min.js'></script>-->
        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
        <script src='https://cdnjs.cloudflare.com/ajax/libs/regression/1.4.0/regression.min.js'></script>
        <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
        <script src='{% static "interface/historyGraphing.js" %}'></script>
    </head>