Widgets are generally used for cross site information sharing, and are made up of javascript and any of the server side scripting language. For example, a weather information site can create a weather information widget which i can put on my site to display current weather information of my city.