{"id":2150,"date":"2017-02-16T15:18:13","date_gmt":"2017-02-16T15:18:13","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=2150"},"modified":"2022-07-14T13:35:04","modified_gmt":"2022-07-14T13:35:04","slug":"file-type-extension-validation-javascript","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/","title":{"rendered":"File Type (extension) Validation with JavaScript"},"content":{"rendered":"<p><b>File type validation<\/b> before uploading to the server is mandatory for every file upload in the web application. It helps to ensure that the user has selected the correct types of files to upload. Client-side validation is more user-friendly than server-side. It will be a good idea to validate the file type before submitting to upload. Using JavaScript, you can easily check the selected file extension with allowed file extensions.<\/p>\n<p>In this tutorial, we will show how you can implement <b>file extension validation in JavaScript<\/b>. Using our file type validation script, you can restrict the user to upload only the allowed file types.<\/p>\n<p>In our example script, we will <b>validate image file using JavaScript<\/b> and allow user to select only .jpg, .jpeg, .png, and .gif type file. If the selected file extension is not matched with the specified types, the alert message will be shown to the user. Otherwise, the chosen image preview will be displayed under the file input field.<\/p>\n<h2>JavaScript Code<\/h2>\n<p>The <code>fileValidation()<\/code> function contains the complete file type validation code. This JavaScript function needs to call for file extension validation.<\/p>\n<pre><span style=\"color:#a71d5d;font-style:italic\">function<\/span> <span style=\"color:#bf4f24\">fileValidation<\/span>(){\r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> fileInput <span style=\"color:#794938\">=<\/span> <span style=\"color:#691c97\">document<\/span>.<span style=\"color:#693a17\">getElementById<\/span>(<span style=\"color:#0b6125\">'file'<\/span>);\r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> filePath <span style=\"color:#794938\">=<\/span> fileInput.<span style=\"color:#b4371f\">value<\/span>;\r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> allowedExtensions <span style=\"color:#794938\">=<\/span><span style=\"color:#cf5628\"> \/(<span style=\"color:#811f24;font-weight:700\">\\.<\/span>jpg|<span style=\"color:#811f24;font-weight:700\">\\.<\/span>jpeg|<span style=\"color:#811f24;font-weight:700\">\\.<\/span>png|<span style=\"color:#811f24;font-weight:700\">\\.<\/span>gif)$\/i<\/span>;\r\n    <span style=\"color:#794938\">if<\/span>(<span style=\"color:#794938\">!<\/span>allowedExtensions.<span style=\"color:#693a17\">exec<\/span>(filePath)){\r\n        <span style=\"color:#693a17\">alert<\/span>(<span style=\"color:#0b6125\">'Please upload file having extensions .jpeg\/.jpg\/.png\/.gif only.'<\/span>);\r\n        fileInput.<span style=\"color:#b4371f\">value<\/span> <span style=\"color:#794938\">=<\/span> <span style=\"color:#0b6125\">''<\/span>;\r\n        <span style=\"color:#794938\">return<\/span> <span style=\"color:#811f24;font-weight:700\">false<\/span>;\r\n    }<span style=\"color:#794938\">else<\/span>{\r\n        <span style=\"color:#5a525f;font-style:italic\">\/\/Image preview<\/span>\r\n        <span style=\"color:#794938\">if<\/span> (fileInput.files <span style=\"color:#794938\">&amp;<\/span><span style=\"color:#794938\">&amp;<\/span> fileInput.files[<span style=\"color:#811f24;font-weight:700\">0<\/span>]) {\r\n            <span style=\"color:#a71d5d;font-style:italic\">var<\/span> reader <span style=\"color:#794938\">=<\/span> <span style=\"color:#794938\">new<\/span> <span style=\"color:#bf4f24\">FileReader<\/span>();\r\n            <span style=\"color:#691c97\">reader<\/span>.<span style=\"color:#bf4f24\">onload<\/span> <span style=\"color:#794938\">=<\/span> <span style=\"color:#a71d5d;font-style:italic\">function<\/span>(e) {\r\n                <span style=\"color:#691c97\">document<\/span>.<span style=\"color:#693a17\">getElementById<\/span>(<span style=\"color:#0b6125\">'imagePreview'<\/span>).innerHTML <span style=\"color:#794938\">=<\/span> <span style=\"color:#0b6125\">'&lt;img src=\"'<\/span><span style=\"color:#794938\">+<\/span>e.<span style=\"color:#b4371f\">target<\/span>.result<span style=\"color:#794938\">+<\/span><span style=\"color:#0b6125\">'\"\/>'<\/span>;\r\n            };\r\n            reader.readAsDataURL(fileInput.files[<span style=\"color:#811f24;font-weight:700\">0<\/span>]);\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>Image file extensions regex is defined in <code>allowedExtensions<\/code> variable. If you want to validate other file types, change the regex with allowed extensions.<\/p>\n<h2>HTML Code<\/h2>\n<p>On file select, the <code>fileValidation()<\/code> function will be executed. If the allowed file types are selected, image preview will be shown in <code>imagePreview<\/code> div.<\/p>\n<pre><span style=\"color:#5a525f;font-style:italic\">&lt;!-- File input field --><\/span>\r\n&lt;<span style=\"color:#bf4f24\">input<\/span> <span style=\"color:#bf4f24\">type<\/span>=<span style=\"color:#0b6125\">\"file\"<\/span> <span style=\"color:#bf4f24\">id<\/span><span style=\"color:#794938\">=<\/span><span style=\"color:#0b6125\">\"file\"<\/span> <span style=\"color:#bf4f24\">onchange<\/span>=<span style=\"color:#0b6125\">\"return fileValidation()\"<\/span>\/>\r\n\r\n<span style=\"color:#5a525f;font-style:italic\">&lt;!-- Image preview --><\/span>\r\n&lt;<span style=\"color:#bf4f24\">div<\/span> <span style=\"color:#bf4f24\">id<\/span><span style=\"color:#794938\">=<\/span><span style=\"color:#0b6125\">\"imagePreview\"<\/span>>&lt;\/<span style=\"color:#bf4f24\">div<\/span>>\r\n<\/pre>\n<h2>Conclusion<\/h2>\n<p>Here we have shown only the image file type validation, you can use this same script for other file types validation. You only need to specify the allowed file extensions on <code>allowedExtensions<\/code> variable in JavaScript code. Apart from the file type validation, this script will help to display <b>image preview without upload using JavaScript<\/b>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>File type validation before uploading to the server is mandatory for every file upload in the web application. It helps to ensure that the user has selected the correct types of files to upload. Client-side <\/p>\n","protected":false},"author":1,"featured_media":2151,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[10],"tags":[132,66,257],"class_list":["post-2150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-file","tag-javascript","tag-validation","cat-10-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>File Type (extension) Validation with JavaScript - CodexWorld<\/title>\n<meta name=\"description\" content=\"Javascript file extension validation - How to validate image type using JavaScript. Example script to validate file type or extension with JavaScript and display preview before upload.\" \/>\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.codexworld.com\/file-type-extension-validation-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"File Type (extension) Validation with JavaScript - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Javascript file extension validation - How to validate image type using JavaScript. Example script to validate file type or extension with JavaScript and display preview before upload.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-16T15:18:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-14T13:35:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/02\/file-type-extension-validation-javascript-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"File Type (extension) Validation with JavaScript\",\"datePublished\":\"2017-02-16T15:18:13+00:00\",\"dateModified\":\"2022-07-14T13:35:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/\"},\"wordCount\":288,\"commentCount\":8,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/file-type-extension-validation-javascript-codexworld.png\",\"keywords\":[\"File\",\"JavaScript\",\"Validation\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/\",\"name\":\"File Type (extension) Validation with JavaScript - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/file-type-extension-validation-javascript-codexworld.png\",\"datePublished\":\"2017-02-16T15:18:13+00:00\",\"dateModified\":\"2022-07-14T13:35:04+00:00\",\"description\":\"Javascript file extension validation - How to validate image type using JavaScript. Example script to validate file type or extension with JavaScript and display preview before upload.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/file-type-extension-validation-javascript-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/file-type-extension-validation-javascript-codexworld.png\",\"width\":1366,\"height\":768,\"caption\":\"file-type-extension-validation-javascript-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/file-type-extension-validation-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"File Type (extension) Validation with JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"File Type (extension) Validation with JavaScript - CodexWorld","description":"Javascript file extension validation - How to validate image type using JavaScript. Example script to validate file type or extension with JavaScript and display preview before upload.","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.codexworld.com\/file-type-extension-validation-javascript\/","og_locale":"en_US","og_type":"article","og_title":"File Type (extension) Validation with JavaScript - CodexWorld","og_description":"Javascript file extension validation - How to validate image type using JavaScript. Example script to validate file type or extension with JavaScript and display preview before upload.","og_url":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2017-02-16T15:18:13+00:00","article_modified_time":"2022-07-14T13:35:04+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/02\/file-type-extension-validation-javascript-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"File Type (extension) Validation with JavaScript","datePublished":"2017-02-16T15:18:13+00:00","dateModified":"2022-07-14T13:35:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/"},"wordCount":288,"commentCount":8,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/02\/file-type-extension-validation-javascript-codexworld.png","keywords":["File","JavaScript","Validation"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/","url":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/","name":"File Type (extension) Validation with JavaScript - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/02\/file-type-extension-validation-javascript-codexworld.png","datePublished":"2017-02-16T15:18:13+00:00","dateModified":"2022-07-14T13:35:04+00:00","description":"Javascript file extension validation - How to validate image type using JavaScript. Example script to validate file type or extension with JavaScript and display preview before upload.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/02\/file-type-extension-validation-javascript-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/02\/file-type-extension-validation-javascript-codexworld.png","width":1366,"height":768,"caption":"file-type-extension-validation-javascript-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/file-type-extension-validation-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"File Type (extension) Validation with JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/02\/file-type-extension-validation-javascript-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-yG","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/2150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=2150"}],"version-history":[{"count":3,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/2150\/revisions"}],"predecessor-version":[{"id":5005,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/2150\/revisions\/5005"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/2151"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=2150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=2150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=2150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}