Can I change the page's HTML status code on the client side?

后端 未结 5 1817
刺人心
刺人心 2021-01-18 00:24

I have a static HTML web page and I want to set its status code to 404 \"Not found\".

But, I want to do this using javascript or jQuery, not any server

5条回答
  •  北恋
    北恋 (楼主)
    2021-01-18 00:51

    I think the sense behind this exercise is the following: You want to load a page that displays a custom error message to your users. At the same time you want to tell your Google Search Appliance (or alike systems) that the requested page must be deleted from the index. I have the same problem where server-side scripts cannot be embedded. I haven't found a client-side solution yet.

提交回复
热议问题