{"id":556,"date":"2022-11-05T10:11:02","date_gmt":"2022-11-05T10:11:02","guid":{"rendered":"https:\/\/www.devopstrainer.in\/blog\/?p=556"},"modified":"2022-11-05T10:11:02","modified_gmt":"2022-11-05T10:11:02","slug":"what-is-javascript-how-to-add-javascript-2","status":"publish","type":"post","link":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/","title":{"rendered":"What is JAVASCRIPT, How to add JAVASCRIPT ?"},"content":{"rendered":"\n<p>JavaScript  is  object-oriented programming language which is used by several websites for scripting the webpages. It is an interpreted, full-fledged programming language that enables dynamic interactivity on websites when applied to an HTML document.<\/p>\n\n\n\n<p><strong>Features of javascript<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>All  web browsers support JavaScript as they provide built-in execution environments.<\/li><li>JavaScript follows the syntax and structure of the C programming language.<\/li><li>It is a case-sensitive language.<\/li><li>JavaScript is supportable in several operating systems including, Windows, macOS, e<\/li><li>It provides good control to the users over the web browsers.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">How to add Javascript?<\/h2>\n\n\n\n<p><strong>There are two ways to add javascript in the file. <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Inline way<\/li><li>external way<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Inline way to add javascript<\/h3>\n\n\n\n<p>In this, we have two options &#8211; <strong>Head tag and Body tag<\/strong>   or JavaScript can be added directly to the HTML file by writing the code inside the &lt;script&gt; tag . We can place the &lt;script&gt; tag &nbsp;either inside &lt;head&gt; or the &lt;body&gt; tag &nbsp;according to the need.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">Syntax = <span style=\"background-color: inherit; font-family: inherit; font-size: inherit; color: initial;\">&lt;script type= \"text\/javascript<\/span>\"> &lt;\/script><\/mark><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">External way to add javascript<\/h3>\n\n\n\n<p>in this also, we have two option to add our code in the file- Head tag and Body tag  or The other way is to write JavaScript code in another file having a .js extension and then link the file inside the &lt;head&gt; or &lt;body&gt; tag of the HTML file in which we want to add this code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">syntax= &lt;script src = \"filename.js\"  type =  \"text\/javascript\">&lt;\/script><\/mark><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript is object-oriented programming language which is used by several websites for scripting the webpages. It is an interpreted, full-fledged programming language that enables dynamic interactivity on websites when applied&hellip;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-556","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is JAVASCRIPT, How to add JAVASCRIPT ? - DevOps | SRE | DevSecOps<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is JAVASCRIPT, How to add JAVASCRIPT ? - DevOps | SRE | DevSecOps\" \/>\n<meta property=\"og:description\" content=\"JavaScript is object-oriented programming language which is used by several websites for scripting the webpages. It is an interpreted, full-fledged programming language that enables dynamic interactivity on websites when applied&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps | SRE | DevSecOps\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-05T10:11:02+00:00\" \/>\n<meta name=\"author\" content=\"shivam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"shivam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/\"},\"author\":{\"name\":\"shivam\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\"},\"headline\":\"What is JAVASCRIPT, How to add JAVASCRIPT ?\",\"datePublished\":\"2022-11-05T10:11:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/\"},\"wordCount\":240,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/\",\"name\":\"What is JAVASCRIPT, How to add JAVASCRIPT ? - DevOps | SRE | DevSecOps\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#website\"},\"datePublished\":\"2022-11-05T10:11:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.devopstrainer.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is JAVASCRIPT, How to add JAVASCRIPT ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#website\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/\",\"name\":\"DevOps | SRE | DevSecOps\",\"description\":\"Automation means Cost, Quality, Time\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.devopstrainer.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\",\"name\":\"shivam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g\",\"caption\":\"shivam\"},\"url\":\"https:\/\/www.devopstrainer.in\/blog\/author\/shivam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is JAVASCRIPT, How to add JAVASCRIPT ? - DevOps | SRE | DevSecOps","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/","og_locale":"en_US","og_type":"article","og_title":"What is JAVASCRIPT, How to add JAVASCRIPT ? - DevOps | SRE | DevSecOps","og_description":"JavaScript is object-oriented programming language which is used by several websites for scripting the webpages. It is an interpreted, full-fledged programming language that enables dynamic interactivity on websites when applied&hellip;","og_url":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/","og_site_name":"DevOps | SRE | DevSecOps","article_published_time":"2022-11-05T10:11:02+00:00","author":"shivam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"shivam","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/#article","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/"},"author":{"name":"shivam","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53"},"headline":"What is JAVASCRIPT, How to add JAVASCRIPT ?","datePublished":"2022-11-05T10:11:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/"},"wordCount":240,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/","url":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/","name":"What is JAVASCRIPT, How to add JAVASCRIPT ? - DevOps | SRE | DevSecOps","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#website"},"datePublished":"2022-11-05T10:11:02+00:00","author":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53"},"breadcrumb":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-javascript-how-to-add-javascript-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.devopstrainer.in\/blog\/"},{"@type":"ListItem","position":2,"name":"What is JAVASCRIPT, How to add JAVASCRIPT ?"}]},{"@type":"WebSite","@id":"https:\/\/www.devopstrainer.in\/blog\/#website","url":"https:\/\/www.devopstrainer.in\/blog\/","name":"DevOps | SRE | DevSecOps","description":"Automation means Cost, Quality, Time","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopstrainer.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53","name":"shivam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g","caption":"shivam"},"url":"https:\/\/www.devopstrainer.in\/blog\/author\/shivam\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/comments?post=556"}],"version-history":[{"count":3,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/556\/revisions"}],"predecessor-version":[{"id":560,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/556\/revisions\/560"}],"wp:attachment":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/media?parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/categories?post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/tags?post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}