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

后端 未结 5 1823
刺人心
刺人心 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 01:01

    You can redirect the page to a non existent one in JavaScript. I have no idea why you would want to do this, but hey ho:

    
    

    But David is right, there is no way to set THAT pages status as it is a client side script.

提交回复
热议问题