Sign in

Link and Src can both refer to external files. Does that mean that they can be called across domains?

Pawel edited in Tue, 23 Aug 2022

For example:

General call JS JSON file, use SRC = " xxx.js “

Is link the same?

Why CSS uses link JS and Src? Does the great God know?

1 Replies
commented on Tue, 23 Aug 2022

In theory, SRC expresses that the content of the element will be replaced as a whole. For example, IMG element, script element and iframe element are all like this. And the expression of "a" is a hyperlink. For example, a element, link element. As for the reason why we decided to link external style sheets instead of loading them with style SRC at the beginning, it may be because the sages thought that style sheets were more in line with the characteristics of external linked resources, and they were closer to affiliated resources than embedded content. For example, consider alternate stylesheets. You only need to link a set of stylesheets at the same time, instead of loading all of them. Of course, you can simply attribute it to a legacy of history (that is, an accidental decision made by a browser developer).

lock This question has been locked and the reply function has been disabled.