sách gpt4 ai đã đi

javascript - tệp .htc - tôi có cần máy chủ web không?

In lại 作者:行者123 更新时间:2023-12-02 16:58:13 28 4
mua khóa gpt4 Nike

我想使用PIE在我的项目中使用 IE7。

但是我不明白的是,我只能在网络服务器上使用 .htc 文件吗?

我可以在没有网络服务器的情况下通过浏览器加载的本地页面中使用它吗?

我在 PIE 的文档中看到了下面的文字:

Serving the correct Content-Type

IE requires that HTC behaviors are served up with a content-type header of "text/x-component", otherwise it will simply ignore the behavior. Many web servers are preconfigured to serve the correct content-type, but others are not.

If you have problems with the PIE behavior not being applied, check your server configuration and if possible update it to use the correct content-type. For Apache, you can do this in a .htaccess file:

AddType text/x-component .htc

那么,如果我需要通过“text/x-component”加载,我可以通过 AJAX 来做到这一点吗?

1 Câu trả lời

它与 AJAX 没有任何关系:)

这只是文件的响应头。例如。 HTML 页面通常是 text/html“内容类型”。 javascript 文件是 application/javascript。这称为 mime 类型或内容类型,可帮助浏览器了解其接收的文件类型。

您需要将 .htaccess 文件添加到主文件夹中的 Web 项目中,该文件具有:

AddType 文本/x-component htc

或者将完全相同的行添加到您的 apache/虚拟主机配置中。

关于javascript - 文件 .htc 文件 - 我需要网络服务器吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25994618/

28 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com