{"id":629,"date":"2017-05-21T10:11:13","date_gmt":"2017-05-21T03:11:13","guid":{"rendered":"http:\/\/www.yellowweb.id\/blog\/?p=629"},"modified":"2017-05-21T10:11:13","modified_gmt":"2017-05-21T03:11:13","slug":"back-button-with-notification","status":"publish","type":"post","link":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/","title":{"rendered":"Back Button with Notification"},"content":{"rendered":"<p>Membuat tombol kembali atau back button dan notifikasi pada sebuah web sangatlah mudah, teman-teman bisa mencoba tutorial berikut ini. Disini kita akan menggunakan dengan menggunakan versi javascript, yuk kita coba tutorialnya.<br \/>\n<!--more--><\/p>\n<p>Untuk notifikasi implementasinya kita bisa lihat saat ingin posting atau membuat status di facebook, namun kita belum sempat mempublis, atau kita menekan tombol refresh pada browser biasanya akan muncul notifikasi, &#8220;Apakah anda ingin meninggalkan halaman ini?&#8221;.<\/p>\n<p>Kalian bisa menempatkan source code berikut ini pada halaman web.<\/p>\n<pre class=\"lang:default decode:true \" >&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n\t&lt;title&gt;Back Button Javascript | YELLOWWEB.ID&lt;\/title&gt;\r\n\t\r\n\t&lt;script type=\"text\/javascript\"&gt;\r\n\t\twindow.onbeforeunload = function() {\r\n\t\t  return \"Apakah anda akan meninggalkan halaman ini ?\";\r\n\t\t};\r\n\t&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;input type=\"button\" value=\"Go Back\" onclick=\"history.back(-1)\" \/&gt;\r\n\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Silahkan dicoba, untuk tutorial berikutnya mungkin masih seputar manipulasi window pada browser.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Membuat tombol kembali atau back button dan notifikasi pada sebuah web sangatlah mudah, teman-teman bisa mencoba tutorial berikut ini. Disini kita akan menggunakan dengan menggunakan versi javascript, yuk kita coba tutorialnya.<\/p>\n","protected":false},"author":1,"featured_media":631,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[283,11],"tags":[336,203,335,334],"class_list":["post-629","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-tutorial","tag-alert","tag-browser","tag-notifikasi","tag-window"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Back Button with Notification - YELLOWWEB.ID<\/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.yellowweb.id\/blog\/back-button-with-notification\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Back Button with Notification - YELLOWWEB.ID\" \/>\n<meta property=\"og:description\" content=\"Membuat tombol kembali atau back button dan notifikasi pada sebuah web sangatlah mudah, teman-teman bisa mencoba tutorial berikut ini. Disini kita akan menggunakan dengan menggunakan versi javascript, yuk kita coba tutorialnya.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/\" \/>\n<meta property=\"og:site_name\" content=\"YELLOWWEB.ID\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-21T03:11:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/05\/notifikasi_alert_yellowweb.png?fit=482%2C236&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"482\" \/>\n\t<meta property=\"og:image:height\" content=\"236\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"yellowweb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"yellowweb\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated 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.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/\"},\"author\":{\"name\":\"yellowweb\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\"},\"headline\":\"Back Button with Notification\",\"datePublished\":\"2017-05-21T03:11:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/\"},\"wordCount\":93,\"image\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/05\\\/notifikasi_alert_yellowweb.png\",\"keywords\":[\"alert\",\"browser\",\"notifikasi\",\"window\"],\"articleSection\":[\"JavaScript\",\"Tutorial\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/\",\"name\":\"Back Button with Notification - YELLOWWEB.ID\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/05\\\/notifikasi_alert_yellowweb.png\",\"datePublished\":\"2017-05-21T03:11:13+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/05\\\/notifikasi_alert_yellowweb.png\",\"contentUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/05\\\/notifikasi_alert_yellowweb.png\",\"width\":482,\"height\":236,\"caption\":\"Notifikasi Window\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/back-button-with-notification\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Back Button with Notification\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/\",\"name\":\"YELLOWWEB.ID\",\"description\":\"Kursus Web Design | Kursus Web Programming | Mobile Web Apps | Digital Marketing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\",\"name\":\"yellowweb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"caption\":\"yellowweb\"},\"sameAs\":[\"https:\\\/\\\/www.yellowweb.id\"],\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/author\\\/yellowweb\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Back Button with Notification - YELLOWWEB.ID","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.yellowweb.id\/blog\/back-button-with-notification\/","og_locale":"en_GB","og_type":"article","og_title":"Back Button with Notification - YELLOWWEB.ID","og_description":"Membuat tombol kembali atau back button dan notifikasi pada sebuah web sangatlah mudah, teman-teman bisa mencoba tutorial berikut ini. Disini kita akan menggunakan dengan menggunakan versi javascript, yuk kita coba tutorialnya.","og_url":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/","og_site_name":"YELLOWWEB.ID","article_published_time":"2017-05-21T03:11:13+00:00","og_image":[{"width":482,"height":236,"url":"https:\/\/i0.wp.com\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/05\/notifikasi_alert_yellowweb.png?fit=482%2C236&ssl=1","type":"image\/png"}],"author":"yellowweb","twitter_card":"summary_large_image","twitter_misc":{"Written by":"yellowweb","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/#article","isPartOf":{"@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/"},"author":{"name":"yellowweb","@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829"},"headline":"Back Button with Notification","datePublished":"2017-05-21T03:11:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/"},"wordCount":93,"image":{"@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/#primaryimage"},"thumbnailUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/05\/notifikasi_alert_yellowweb.png","keywords":["alert","browser","notifikasi","window"],"articleSection":["JavaScript","Tutorial"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/","url":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/","name":"Back Button with Notification - YELLOWWEB.ID","isPartOf":{"@id":"https:\/\/www.yellowweb.id\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/#primaryimage"},"image":{"@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/#primaryimage"},"thumbnailUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/05\/notifikasi_alert_yellowweb.png","datePublished":"2017-05-21T03:11:13+00:00","author":{"@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829"},"breadcrumb":{"@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/#primaryimage","url":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/05\/notifikasi_alert_yellowweb.png","contentUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/05\/notifikasi_alert_yellowweb.png","width":482,"height":236,"caption":"Notifikasi Window"},{"@type":"BreadcrumbList","@id":"https:\/\/www.yellowweb.id\/blog\/back-button-with-notification\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.yellowweb.id\/blog\/"},{"@type":"ListItem","position":2,"name":"Back Button with Notification"}]},{"@type":"WebSite","@id":"https:\/\/www.yellowweb.id\/blog\/#website","url":"https:\/\/www.yellowweb.id\/blog\/","name":"YELLOWWEB.ID","description":"Kursus Web Design | Kursus Web Programming | Mobile Web Apps | Digital Marketing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.yellowweb.id\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829","name":"yellowweb","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","caption":"yellowweb"},"sameAs":["https:\/\/www.yellowweb.id"],"url":"https:\/\/www.yellowweb.id\/blog\/author\/yellowweb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/comments?post=629"}],"version-history":[{"count":1,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/629\/revisions"}],"predecessor-version":[{"id":630,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/629\/revisions\/630"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/media\/631"}],"wp:attachment":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/media?parent=629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/categories?post=629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/tags?post=629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}