What is the difference between “lang” and “type” attributes in a script tag?

后端 未结 7 1167
攒了一身酷
攒了一身酷 2020-12-05 15:54

For

7条回答
  •  猫巷女王i
    2020-12-05 16:14

    The OP specifically said "lang" not "language". The much older "language" tag would have been Javascript or VBScript.

    But the current and seemingly valid "lang" tag is actually which written language like English, Spanish, Japanese. Microsoft's Visual Studio provides a dropdown list for the values for "lang" and they are all like en-us, fr, ja, etc.. for English US, French, Japanese, etc...

    I'm thinking there could be valid reasons for using this tag if you have a complex multilingual setup - maybe there's a content mgmt system that could support this and then deliver the proper javascript file - like jQuery control resources?

提交回复
热议问题