简体   繁体   English

使用(客户端)Javascript修改HTTP响应标头

[英]Modify HTTP response header with (Client-side) Javascript

I'm working on a website, and I've run into trouble modifying an HTTP Response header using (client-side) JavaScript. 我在一个网站上工作,并且遇到了使用(客户端)JavaScript修改HTTP响应标头的麻烦。 I have exactly zero idea how to do this. 我完全不知道该怎么做。 I know (roughly) how to make the 'for' loop to modify the header, but I don't know how to access the header within the script. 我知道(大致)如何使“ for”循环修改标题,但是我不知道如何在脚本中访问标题。 Could y'all fine people help me with this fun task? 大家都可以帮我完成这项有趣的任务吗?

With client-side JavaScript (JavaScript running in a browser), you can't do this; 使用客户端 JavaScript(运行在浏览器中的JavaScript),您将无法执行此操作。 by the time the JavaScript code runs, the headers have already been processed. 到JavaScript代码运行时,标头已经被处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM