{"id":3106,"date":"2015-04-06T16:15:07","date_gmt":"2015-04-06T13:15:07","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=3106"},"modified":"2018-01-10T15:10:13","modified_gmt":"2018-01-10T13:10:13","slug":"javascript-document-write-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/","title":{"rendered":"Javascript document.write() example"},"content":{"rendered":"<p>In this article we&#8217;ll consider some examples of using <code>document.write()<\/code> method.<\/p>\n<p>This method is commonly used for testing and dynamically generating page content while it&#8217;s loading. <\/p>\n<p>It&#8217;s a fast way to modify the document and may be used as an alternative to other approaches which are more suitable when the DOM is completely ready.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n[ulp id=&#8217;tCIwOngQUb3zSUuF&#8217;]<br \/>\n&nbsp;<br \/>\nTake a look at one small example. This code just outputs custom text while executing the script:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        document.write(&quot;Custom text&quot;);\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Now we&#8217;re going to add some tags. One should notice that the new div tag is appended right after the closing script tag:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        document.write(&quot;&lt;div&gt;Custom text&lt;\/div&gt;&quot;);\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>and it&#8217;s equal to<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n    &lt;\/script&gt;&lt;div&gt;Custom text&lt;\/div&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>If we want to append &#8216;\\n&#8217; after the line, we can use <code>document.writeln()<\/code>:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        &lt;code&gt;document.writeln(&quot;&lt;div&gt;First line&lt;\/div&gt;&quot;);&lt;\/code&gt;\r\n        &lt;code&gt;document.writeln(&quot;&lt;div&gt;Second line&lt;\/div&gt;&quot;);&lt;\/code&gt;\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>It is possible to pass several arguments to the method, for example:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        document.write(&quot;&lt;ul&gt;&quot;, \/\/ This is zero argument\r\n                       &quot;&lt;li&gt;First argument&lt;\/li&gt;&quot;,\r\n                       &quot;&lt;li&gt;Second argument&lt;\/li&gt;&quot;,\r\n                       &quot;&lt;\/ul&gt;&quot;,\r\n                       new Date());\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Avoid such situations. It&#8217;s pretty easy to make a mistake using closing tags:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        document.write(&quot;end of div from script&lt;\/body&gt;&quot;);\r\n    &lt;\/script&gt;\r\n    &lt;\/div&gt; &lt;!-- this tag is missing --&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Let&#8217;s go deeper. When creating a new window, we can finish writing after the document was loaded. Next time you click the button, document will be overwritten<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        var w = window.open();\r\n        w.document.open();\r\n        w.document.writeln(&quot;Started&lt;br\/&gt;&quot;);\r\n        function finish() {\r\n            w.document.writeln(&quot;Finished&quot;);\r\n            w.document.close();\r\n        }\r\n    &lt;\/script&gt;\r\n    &lt;button onclick=&quot;finish();&quot;&gt;Finish&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>We can even finish writing step by step:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        var wind = window.open();\r\n        var counter = 0;\r\n        wind.document.open();\r\n        wind.document.writeln(&quot;Started&lt;br\/&gt;&quot;);\r\n        function finishStepByStep() {\r\n            if (counter &gt; 3)\r\n                wind.document.close();\r\n            else\r\n                wind.document.writeln(&quot;Finished with counter = &quot; + counter++ + &quot;&lt;br\/&gt;&quot;);\r\n        }\r\n    &lt;\/script&gt;\r\n    &lt;button onclick=&quot;finishStepByStep();&quot;&gt;Finish&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>We can add scripts using <code>document.write()<\/code>!<\/p>\n<p>Note that closing script tag in the string argument should be separated not to be interpreted by a browser as an end of scripting part (or one of the symbols should be replaced by its escape-sequence)<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        document.write('&lt;script&gt;alert(&quot;lalala&quot;);&lt;\/scr' + 'ipt&gt;')\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>We can even call <code>document.write()<\/code> from <code>document.write()<\/code>:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        document.write('&lt;script&gt;document.write(&quot;second level lalala&quot;);&lt;\\x2fscript&gt;')\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>We can call the predefined function:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n    &lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;script&gt;\r\n        function callAlert() {\r\n            alert(&quot;This is called from predefined function&quot;);\r\n        }\r\n        document.write('&lt;script&gt;callAlert();&lt;\\x2fscript&gt;')\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Try to avoid loading third-party scripts using <code>document.write()<\/code> because it can slow down page rendering.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>You can download the full source code of this example here: <a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/Samples.zip\"><strong>JavascriptDocumentWrite<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article we&#8217;ll consider some examples of using document.write() method. This method is commonly used for testing and dynamically generating page content while it&#8217;s loading. It&#8217;s a fast way to modify the document and may be used as an alternative to other approaches which are more suitable when the DOM is completely ready. &nbsp; &hellip;<\/p>\n","protected":false},"author":74,"featured_media":920,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-3106","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Javascript document.write() example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In this article we&#039;ll consider some examples of using document.write() method. This method is commonly used for testing and dynamically generating page\" \/>\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.webcodegeeks.com\/javascript\/javascript-document-write-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Javascript document.write() example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In this article we&#039;ll consider some examples of using document.write() method. This method is commonly used for testing and dynamically generating page\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/dimbasick\" \/>\n<meta property=\"article:published_time\" content=\"2015-04-06T13:15:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-10T13:10:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Dmitry Mishchenko\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dimbasick\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dmitry Mishchenko\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/\"},\"author\":{\"name\":\"Dmitry Mishchenko\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/590734bdf375bf270d42b06f878f6e57\"},\"headline\":\"Javascript document.write() example\",\"datePublished\":\"2015-04-06T13:15:07+00:00\",\"dateModified\":\"2018-01-10T13:10:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/\"},\"wordCount\":861,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/\",\"name\":\"Javascript document.write() example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"datePublished\":\"2015-04-06T13:15:07+00:00\",\"dateModified\":\"2018-01-10T13:10:13+00:00\",\"description\":\"In this article we'll consider some examples of using document.write() method. This method is commonly used for testing and dynamically generating page\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Javascript document.write() example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/590734bdf375bf270d42b06f878f6e57\",\"name\":\"Dmitry Mishchenko\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/52a7208c47939e10b039bf165c7a545b198cc1d6b716ab0eea58add16782782c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/52a7208c47939e10b039bf165c7a545b198cc1d6b716ab0eea58add16782782c?s=96&d=mm&r=g\",\"caption\":\"Dmitry Mishchenko\"},\"description\":\"This year I graduate from Applied Mathematics department of Brest State University. I'm fond of genetic algorithms and my degree work will be about generating timetables. Also I'm keen on programming and web-development, especially Java and Javascript. Now I work as a Java Developer at Java department of VRP Consulting.\",\"sameAs\":[\"https:\/\/www.facebook.com\/dimbasick\",\"https:\/\/www.linkedin.com\/profile\/view?id=296022174\",\"https:\/\/x.com\/dimbasick\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/dmitry-mishchenko\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Javascript document.write() example - Web Code Geeks - 2026","description":"In this article we'll consider some examples of using document.write() method. This method is commonly used for testing and dynamically generating page","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.webcodegeeks.com\/javascript\/javascript-document-write-example\/","og_locale":"en_US","og_type":"article","og_title":"Javascript document.write() example - Web Code Geeks - 2026","og_description":"In this article we'll consider some examples of using document.write() method. This method is commonly used for testing and dynamically generating page","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/dimbasick","article_published_time":"2015-04-06T13:15:07+00:00","article_modified_time":"2018-01-10T13:10:13+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","type":"image\/jpeg"}],"author":"Dmitry Mishchenko","twitter_card":"summary_large_image","twitter_creator":"@dimbasick","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Dmitry Mishchenko","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/"},"author":{"name":"Dmitry Mishchenko","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/590734bdf375bf270d42b06f878f6e57"},"headline":"Javascript document.write() example","datePublished":"2015-04-06T13:15:07+00:00","dateModified":"2018-01-10T13:10:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/"},"wordCount":861,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/","name":"Javascript document.write() example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","datePublished":"2015-04-06T13:15:07+00:00","dateModified":"2018-01-10T13:10:13+00:00","description":"In this article we'll consider some examples of using document.write() method. This method is commonly used for testing and dynamically generating page","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-document-write-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"Javascript document.write() example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/590734bdf375bf270d42b06f878f6e57","name":"Dmitry Mishchenko","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/52a7208c47939e10b039bf165c7a545b198cc1d6b716ab0eea58add16782782c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/52a7208c47939e10b039bf165c7a545b198cc1d6b716ab0eea58add16782782c?s=96&d=mm&r=g","caption":"Dmitry Mishchenko"},"description":"This year I graduate from Applied Mathematics department of Brest State University. I'm fond of genetic algorithms and my degree work will be about generating timetables. Also I'm keen on programming and web-development, especially Java and Javascript. Now I work as a Java Developer at Java department of VRP Consulting.","sameAs":["https:\/\/www.facebook.com\/dimbasick","https:\/\/www.linkedin.com\/profile\/view?id=296022174","https:\/\/x.com\/dimbasick"],"url":"https:\/\/www.webcodegeeks.com\/author\/dmitry-mishchenko\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/3106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/74"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=3106"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/3106\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/920"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=3106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=3106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=3106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}