You can find different definitions of widgets. For me here, a web widget is a resource from another website that you can use on your website. In other words, you can "paste" into your HTML code a so-called frame in which some other web page will be visible. For example, a user of your website would like to see how many seconds have passed since he entered your website - there is such a counter below.
Embedding widgets on our websites is a good solution when we need to access resources from other external websites that are not of the same origin as our websites. This is the case when these external websites are hosted on different servers in different domains than our website. You will understand this issue better if you know the security mechanism (SOP) used in web browsers along with the CORS policy.
In general, widgets are developed to be used like traditional applications - click to check it out. However, the developer of widgets takes into account that you can include them in your web pages - so they should give the impression that they are integral parts of your web pages.
copyrights: © 2023