Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/378.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/269.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
CSS、JavaScript和PHP文件的路径_Javascript_Php_Html_Css_Path - Fatal编程技术网

CSS、JavaScript和PHP文件的路径

CSS、JavaScript和PHP文件的路径,javascript,php,html,css,path,Javascript,Php,Html,Css,Path,我创建了一个页面,用于将数据添加到表中(MySQL)。当我连接到本地网络时,我的计算机和服务器上的一切都正常工作。但是当我试图从家里访问应用程序时,似乎CSS和JS文件的路径不正确! 以下是我如何使用office中的链接: 以下是我在家里使用的链接: 下面是我的HTML代码的一部分,以及我如何包含JS和CSS文件。我还使用了一个PHP文件,它的链接也是错误的 <head> <script src="jquery/jquery-ui-timepicker-addon.

我创建了一个页面,用于将数据添加到表中(MySQL)。当我连接到本地网络时,我的计算机和服务器上的一切都正常工作。但是当我试图从家里访问应用程序时,似乎CSS和JS文件的路径不正确! 以下是我如何使用office中的链接:

以下是我在家里使用的链接:

下面是我的HTML代码的一部分,以及我如何包含JS和CSS文件。我还使用了一个PHP文件,它的链接也是错误的

<head>
    <script src="jquery/jquery-ui-timepicker-addon.js"></script>
    <script src="jquery/jquery-ui-sliderAccess.js"></script>
<head>
  <link rel="stylesheet" href="jquery/jquery-ui-timepicker-addon.css">
  <link rel="stylesheet" href="jquery/jquery-ui-timepicker-addon.min.css">
</head>

<script>
....
        $(document).ready(function() {

            $("#techForm").submit(function(e) {
             var url = "call_ans.php";
        });
    });
....
</script>
</head>

....
$(文档).ready(函数(){
$(“#techForm”)。提交(功能(e){
var url=“call_ans.php”;
});
});
....

我不知道JS/CSS的完整路径,但假设它是站点根目录,我建议在
标记下添加以下内容:

您的文件中有输入错误,应该是这样的:

<!DOCTYPE html>
<html>
<head>
    <base href="https://server.domain.eu/moni">
    <script src="jquery/jquery-ui-timepicker-addon.js"></script>
    <script src="jquery/jquery-ui-sliderAccess.js"></script>
    <link rel="stylesheet" href="jquery/jquery-ui-timepicker-addon.css">
    <link rel="stylesheet" href="jquery/jquery-ui-timepicker-addon.min.css">
</head>

<body>
    <script>
        $(document).ready(function()
        {
            $("#techForm").submit(function(e)
            {
                var url = "call_ans.php";
            });
        });
    </script>

</body>

</html>

$(文档).ready(函数()
{
$(“#techForm”)。提交(功能(e)
{
var url=“call_ans.php”;
});
});

最好的解决方案是将direct
href
添加到特定脚本或文件位置。添加base应有帮助,但我/我通常不使用该解决方案:

 <script src="./jquery/jquery-ui-timepicker-addon.js"></script>
 <script src="./jquery/jquery-ui-sliderAccess.js"></script>
 <link rel="stylesheet" href="./jquery/jquery-ui-timepicker-addon.css">
 <link rel="stylesheet" href="./jquery/jquery-ui-timepicker-addon.min.css">


记住在服务器上使用点斜杠进行特定的本地化…

JS和CSS文件的完整路径是什么?使用两个可能会有问题,路径可能不会有问题。只要我在办公室,并且在网络中连接到js,它就可以工作。css的完整路径是\xampp\htdocs\jquery在服务器上,jquery文件夹与此文件的关系在哪里?jquery文件夹是否在同一文件夹中?php文件也是如此,为了帮助您,我认为我们需要更好地理解您的目录结构。作为一个好的实践,您应该删除重复的head标记。我也无法访问php文件!我想也有同样的问题!为php文件添加特定位置以访问它们。在serwer上,您可能对pc上的文件有不同的访问权限。