{"id":4124,"date":"2023-03-02T20:47:10","date_gmt":"2023-03-03T01:47:10","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=4124"},"modified":"2023-03-02T20:47:39","modified_gmt":"2023-03-03T01:47:39","slug":"7a-2-what-does-it-mean-to-be-event-driven","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/03\/02\/7a-2-what-does-it-mean-to-be-event-driven\/","title":{"rendered":"7a (2): What does it mean to be &#8220;event-driven&#8221;?"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4198 alignleft\" src=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/events-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/events-300x225.jpg 300w, https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/events-768x576.jpg 768w, https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/events.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>When we talk about JavaScript being &#8220;event-driven&#8221;, it means that the output of the program is indicated by events, like user inputs (mouse clicks, pressing keys), and messages from other systems. It needs a catalyst in order to execute code. It can be thought of as a change from a neutral state to an excited state, like in chemistry.<\/p>\n<p>In event-driven programs, there is a main loop that listens for events, and produces a callback loop when an event is detected. The program is able to identify events thanks to &#8220;event handlers&#8221;, also called subroutines or methods, and are designed to recognize specific events to respond to. Those event handlers have to be binded to the correct function so that they execute the corresponding code\/actions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When we talk about JavaScript being &#8220;event-driven&#8221;, it means that the output of the program is indicated by events, like user inputs (mouse clicks, pressing keys), and messages from other systems. It needs a catalyst in order to execute code. It can be thought of as a change from a neutral state to an excited [&hellip;]<\/p>\n","protected":false},"author":29253,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[663943],"tags":[],"class_list":{"0":"post-4124","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-instructor","7":"entry"},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/users\/29253"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=4124"}],"version-history":[{"count":3,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4124\/revisions"}],"predecessor-version":[{"id":4204,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4124\/revisions\/4204"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=4124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=4124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=4124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}