Using custom type attribute in [removed] tags such as jQuery's text/x-jquery-tmpl

前端 未结 2 1420
执笔经年
执笔经年 2020-12-29 07:56

I noticed that jquery\'s beta template plugin is using, the type attribute \"text/x-jquery-tmpl\"

e.g



        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 08:46

    No, MIME are provided by the server to identify resources. The browser then acts on the types it recognizes.

    Yes, in the HTTP connection the browser lists the types it can recognize so the server can choose types that fit better (an example here would be HTML 5 and video, where you have some codec options and the browser may support only a subset).

    In this case, the specific MIME helps to signal the browser a warning: "This is not normal Javascript, don't act on it like if it was."

提交回复
热议问题