HTML script tag and non-JS content - Firefox

It looks like this code will request the file in Chrome and IE, but not in Firefox.

<script type="text/my-custom-mime-type" src="test.ashx">
</script>

Is there any specification that says that browsers should only handle mime types related to JavaScript? I know that IE probably supports this because of the story with vbscript.

Once you upload the “content”, how can you access it? Is javascript / jQuery /? there is a way to get this.

UPDATE Thus, there are two parts to which the question must be posed. It seems that for the first part - the browser will load what it will load, and I think you cannot do this based on the answers so far.

Example:
  <script type="text/xml-script">
    <page xmlns="http://schemas.microsoft.com/xml-script/2005">        <components>
          <application load="page_load" />
        </components>
    </page>
  </script>
  </pre>

Microsoft MSAjax. . . MSAjax , , script.

2 - , "" ? , , JavaScript - ? ( Ajax)?

+3
3

- , , mime-, JavaScript?

:

, . , , , , .

script, XMLHttpRequest.

+5

script -

<script src="something.js" type="text/javascript"></script>

<script src="somethingThatWilReturnJavaScriptMime.someextension" type="text/javascript"></script>

, mime script, , / type

, , ,

: /JavaScript

type

+1

. .NET , :

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

Source: https://habr.com/ru/post/1759531/


All Articles