在Safari中发布加载外部文件(CSS和JavaScript) [英] Issue loading external files (CSS and JavaScript) in Safari

查看:213
本文介绍了在Safari中发布加载外部文件(CSS和JavaScript)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的情况,这里我的外部网站文件,JavaScript和CSS,被解释为在Safari浏览器上以某种方式损坏。同样的网站在Internet Explorer看起来不错,但在Safari上javascript和css被完全忽略。如果我通过检查器查看文件,我可以看到Safari将这些文件视为包含垃圾字符 - 亚洲符号或方形框。当我直接导航到文件,但是,它们看起来很好。请参阅下面的网站,在Safari 5中查看示例:

I'm having a bizarre situation here where my external site files, both JavaScript and CSS, are being interpretted as somehow corrupt on Safari browsers. The same site looks fine in Internet Explorer, but on Safari the javascript and css are being completely ignored. If I look at the files through the Inspector, I can see that Safari views these files as containing junk characters -- either asian symbols or square boxes. When I navigate directly to the files, however, they appear just fine. See the site below, viewed in Safari 5, for an example:

http://amsoell.com/dch/castlemoore

如果我将完全相同的CSS或JavaScript嵌入到HTML本身中, 。我不知道这是一个服务器问题,或在我的CSS中的东西,但我在我的智慧结束这里。

If I embed the same exact CSS or JavaScript into the HTML itself, it renders perfectly. I don't know if this is a server issue or something in my CSS, but I'm at my wits end here.

推荐答案

我在您的网站上检查过验证并且无效。但最有趣的是你的包容是 utf-16le 。你应该把你的编码 utf-8 。将< head> 部分中的以下行:

I checked your website for validation and it's not valid. But the most interesting thing is that your enconding is utf-16le. You should put your encoding to utf-8. Just put the following line in your <head> section:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 

这篇关于在Safari中发布加载外部文件(CSS和JavaScript)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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