-1

我正在使用两个单独的 JavaScript 文件,并使用两个单独的脚本标签将它们包含在同一页面上。其中一个文件工作正常,它与日期选择器相关,而另一个具有功能的文件则没有。

但!如果我将第二个具有内部功能的 js 文件的内容放入 wep 页面,它工作正常......请帮助我完成这个..

以下是部分代码:

<head>
<?php include('header.php'); ?>?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Student Details</title>

这是我包含第一个 js 文件的地方,它工作正常(日期选择器)

<script language="javascript" type="text/javascript" src="../js/datetimepicker.js"></script>

这是我包含第二个文件的地方,它具有 js 功能

<script language="javascript" type="text/javascript" src="../js/myFuntions.js"></script>

这是一个调用js文件函数的js函数(我正在使用的函数没有错误)

<script type="text/javascript">

// here I placed a function that called other js functions for the js file that i included but is not working

</script>

</head>

所以当把这些js函数放在另一个文件中并包含在网页上时,停止工作了!

4

1 回答 1

0

首先,您不需要languageandtype属性。您可以摆脱它们,因为它们只会使事情变得更难阅读。

<script src="../js/myFuntions.js"></script>

现在您可以在您的问题您发布的评论中看到您拼错了“功能”,因此请尝试修复它。

<script src="../js/myFunctions.js"></script>
于 2012-09-10T00:33:30.893 回答