我有以下代码...
但显示错误 *未捕获的类型引用无法调用未定义的方法“拆分”*
<script src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var textFile = "nav.txt";
jQuery.get(textFile, function (textFileData) {
var EachLineInTextFile = textFileData.responseText.split("\n");
for (var i = 0, len = EachLineInTextFile.length; i < len; i++) {
STORE_TO_REPLACE = EachLineInTextFile[i];
//STORE_TO_REPLACE: I would have to the entire format of your file to do this.
console.log(STORE_TO_REPLACE);
}
})
});
</script>
nav.txt 文件在下面
a a.aspx
b b.aspx
c c.aspx