{"id":613,"date":"2016-12-02T18:29:33","date_gmt":"2016-12-02T18:29:33","guid":{"rendered":"https:\/\/fluentthemes.com\/?p=613"},"modified":"2019-07-17T08:25:50","modified_gmt":"2019-07-17T08:25:50","slug":"what-is-javascript","status":"publish","type":"post","link":"https:\/\/fluentthemes.com\/what-is-javascript\/","title":{"rendered":"What is JavaScript"},"content":{"rendered":"<p>Every website on the World Wide Web does, in one way or another, rely on JavaScript. But what is a script in the coding world and what does it mean to a web developer?<\/p>\n<p>A script is basically a program that boosts interaction within a website be it launching pop-up menus or responding to every action a web visitor makes like checking out items on an online store. Initially, there were two kinds of scripts available, Java and VB, but most modern websites now run the popular JavaScript.<\/p>\n<h6><strong>Ways to use JavaScript<\/strong><\/h6>\n<p>There are only two distinct ways in which this script can be used; either as an external or internal script. An external script means the web developer stores the script language in a separate file then the HTML pages will access this file whenever required. On the other hand, an internal script means the web developer prefers to store the script files within the HTML document itself.<\/p>\n<h6><strong>When to use internal and external JavaScript<\/strong><\/h6>\n<p>External JavaScript is ideal where a created functionality is going to be accessed by multiple HTML documents at any given time. The web developer will thus keep the script in a separate file that will be used within the HTML documents. In code, this is normally introduced as extension .<strong>js <\/strong>within a &lt;script&gt; tag.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-614\" src=\"https:\/\/fluentthemes.com\/wordpress\/wp-content\/uploads\/2016\/12\/java-one.png\" alt=\"java-one\" width=\"554\" height=\"183\" srcset=\"https:\/\/fluentthemes.com\/wordpress\/wp-content\/uploads\/2016\/12\/java-one.png 554w, https:\/\/fluentthemes.com\/wordpress\/wp-content\/uploads\/2016\/12\/java-one-300x99.png 300w\" sizes=\"(max-width: 554px) 100vw, 554px\" \/><\/p>\n<p>Then we have the internal JavaScript where the web developer decides to include the script as they develop the HTML documents in code. Normally the script is introduced as a header with &lt;script&gt; tag but there is no limit to the number of locations the script can be introduced within in a document. The code below explains it;<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-615\" src=\"https:\/\/fluentthemes.com\/wordpress\/wp-content\/uploads\/2016\/12\/java-two.png\" alt=\"java-two\" width=\"563\" height=\"254\" srcset=\"https:\/\/fluentthemes.com\/wordpress\/wp-content\/uploads\/2016\/12\/java-two.png 563w, https:\/\/fluentthemes.com\/wordpress\/wp-content\/uploads\/2016\/12\/java-two-300x135.png 300w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/strong><\/p>\n<h6><strong>When not to use JavaScript<\/strong><\/h6>\n<p>As explained before, JavaScript runs on almost every browser or website. However, there are still those sites or browsers that run on different scripts thus don\u2019t recognize Java. This will register as an error, when the web user tries to open a page or use the search engine, to the end user in the form of an incomprehensible code.<\/p>\n<p>To prevent this from happening, the web developer thus introduces HTML comments around the script to hide it from older browsers or HTML pages.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-616\" src=\"https:\/\/fluentthemes.com\/wordpress\/wp-content\/uploads\/2016\/12\/java-three.png\" alt=\"java-three\" width=\"608\" height=\"229\" srcset=\"https:\/\/fluentthemes.com\/wordpress\/wp-content\/uploads\/2016\/12\/java-three.png 608w, https:\/\/fluentthemes.com\/wordpress\/wp-content\/uploads\/2016\/12\/java-three-300x113.png 300w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/p>\n<p>That is JavaScript in a nutshell, a programming language that helps web developers introduces interactivity in websites. JavaScript can be internal or external and how these two options are used solely depends on the web developer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A script is basically a program that boosts interaction within a website be it launching pop-up menus or responding to every action a web visitor makes like checking out items on an online store. Initially, there were two kinds of scripts available, Java and VB, but most modern websites now run the popular JavaScript.<\/p>\n","protected":false},"author":1,"featured_media":1771,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60,67,65],"tags":[],"class_list":["post-613","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","category-coding","category-javascript"],"_links":{"self":[{"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/posts\/613"}],"collection":[{"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/comments?post=613"}],"version-history":[{"count":0,"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/posts\/613\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/media\/1771"}],"wp:attachment":[{"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/media?parent=613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/categories?post=613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fluentthemes.com\/wp-json\/wp\/v2\/tags?post=613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}