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

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

    You set redirection for non-existant pages on the server. You will not have a page to work with in the browser, since the page the user requested does not exist.

    In ASP.NET you can set up a default page in the customErrors section of the web.config file like this:

    
      
      
    

提交回复
热议问题