页面index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

</body>
</html>

方法1

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

方法2

document.write("<script src='test.js'></script>");

方法3

var Div = document.getElementById('div);
var Script= document.createElement("script");
Script.type = "text/javascript";
Script.src="index.js";
Div.appendChild(Script);