Chrome会显示看似中文的JavaScript文件 [英] Chrome displays JavaScript file in what appears to be Chinese

查看:65
本文介绍了Chrome会显示看似中文的JavaScript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<!DOCTYPE html>
  <html>
    <head>
  <title></title>
    </head>
    <body>
  <script src="scripts/vendor/require.js"></script>
    </body>
  </html>



js文件



The js file

var d;

这就是全部。该文件曾是其主站点的require.js。但我删除了所有试图弄清楚发生了什么的东西。然后我删除了整个文件并创建了一个新文件(具有相同的名称)。我是否可以通过Chrome更改某些内容来解释文件?我无法重现任何其他项目的问题。我最初也使用 jam 下载了该文件。真的,我可以开始一个新的项目文件夹,可能解决问题,但我很好奇为什么会这样做。也许是愚蠢的事,因为我是新手。

That is all there is. The file used to be require.js from their main site. But I deleted everything trying to figure out what was going on. I then deleted the whole file and created a new file (with the same name). Could I have changed something with Chrome to make in interpret files this way? I can't reproduce the problem with any of my other projects. I also originally downloaded the file using jam. Really I could just start a new project folder and probably solve the problem but I am curious as to why it would do this. Maybe something stupid simple since I am new to this.

推荐答案

这是我的index.html文件的编码问题(我用UTF-8编码重新保存了文件,问题消失了)。谢谢你的帮助。

It was a encoding problem with my index.html file (I re-saved the file with UTF-8 encoding and the problem went away). Thanks for your help.

这篇关于Chrome会显示看似中文的JavaScript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆