the HTML script tag and non-JS content - Firefox

后端 未结 3 591
青春惊慌失措
青春惊慌失措 2021-01-06 17:09

It appears this code will request the file in Chrome and IE but not in Firefox.



        
3条回答
  •  难免孤独
    2021-01-06 17:24

    Are you setting the content type. Guessing .NET here so posting basic idea:

    public class Handler : IHttpHandler {
        public void ProcessRequest (HttpContext context) {
             context.Response.ContentType = "text/javascript";
             context.Response.Write("alert('hello world');");
        }
    }
    

提交回复
热议问题