{"id":1577,"date":"2016-05-15T15:19:45","date_gmt":"2016-05-15T15:19:45","guid":{"rendered":"http:\/\/box.jharaphula.com\/?p=1577"},"modified":"2022-09-04T08:08:03","modified_gmt":"2022-09-04T13:38:03","slug":"cross-browser-javascript-bookmark-function","status":"publish","type":"post","link":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/","title":{"rendered":"Cross Browser Compatible JavaScript Bookmark Function"},"content":{"rendered":"<p>During a visitor visit a web page, if he\/she like the page he\/she do bookmarking for future reference. In such case as a programmer you require a bookmarking script to implement in your app. Look at the below demo app, here I implemented a JavaScript bookmark function. This function is cross browser compatible. By simply copy paste the below code you can easily add bookmarking functionality to your HTML page.<\/p>\n<p>The logic I implemented here is very simple. By using <a href=\"https:\/\/jharaphula.com\/learn-javascript-programming-beginners\/\" target=\"_blank\" rel=\"noopener noreferrer\">JavaScript<\/a> indexOf() method I am checking which kind of browser client is using. Depending upon the browser I am displaying a message about the shortcut key to bookmark in that browser.<\/p>\n<h3>JavaScript Bookmark Function<\/h3>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">function bookmarkPage(url, title) {\r\nif (!url) { url = window.location }\r\nif (!title) { title = document.title }\r\nvar browser = navigator.userAgent.toLowerCase();\r\nif (window.sidebar) { \/\/ for Mozilla, Firefox &amp; Netscape\r\nwindow.sidebar.addPanel(title, url, &quot;&quot;);\r\n} else if (window.external) { \/\/ IE or chrome\r\nif (browser.indexOf('chrome') == -1) { \/\/ ie\r\nwindow.external.AddFavorite(url, title);\r\n} else { \/\/ for Google Chrome\r\nalert('Please Press CTRL+D (or Command+D for macs) to bookmark this page');\r\n}\r\n}\r\nelse if (window.opera &amp;&amp; window.print) { \/\/ Opera - automatically adds to sidebar if rel=sidebar in the tag\r\nreturn true;\r\n}\r\nelse if (browser.indexOf('konqueror') != -1) { \/\/ for Konqueror\r\nalert('Please press CTRL+B to bookmark this page.');\r\n}\r\nelse if (browser.indexOf('webkit') != -1) { \/\/ for Safari\r\nalert('Please press CTRL+B (or Command+D for macs) to bookmark this page.');\r\n} else {\r\nalert('Your browser cannot add bookmarks using this link. Please add this link manually.')\r\n}\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>During a visitor visit a web page, if he\/she like the page he\/she do bookmarking for future reference. In such case as a programmer you&#8230;<\/p>\n","protected":false},"author":2,"featured_media":1894,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[39445,36443,39601,37158,39444],"class_list":["post-1577","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript-code-examples","tag-cache-for-offline-storage","tag-cross-browser","tag-javascript-bookmark-function","tag-javascript-function","tag-using-html5-application-cache"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cross Browser Compatiable JavaScript Bookmark Function<\/title>\n<meta name=\"description\" content=\"Here I implemented a JavaScript bookmark function. This is cross browser compatible. By simply copy &amp; paste you can easily add bookmarking to a HTML 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:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cross Browser Compatiable JavaScript Bookmark Function\" \/>\n<meta property=\"og:description\" content=\"Here I implemented a JavaScript bookmark function. This is cross browser compatible. By simply copy &amp; paste you can easily add bookmarking to a HTML page.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/\" \/>\n<meta property=\"og:site_name\" content=\"OneStop Shop\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/tajinweb\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/panda.biswabhusan\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-15T15:19:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-04T13:38:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"460\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Biswabhusan Panda\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Biswabhusan Panda\" \/>\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:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/\"},\"author\":{\"name\":\"Biswabhusan Panda\",\"@id\":\"https:\/\/jharaphula.com\/#\/schema\/person\/6e9804d6e96ca7218bf968283d69c01b\"},\"headline\":\"Cross Browser Compatible JavaScript Bookmark Function\",\"datePublished\":\"2016-05-15T15:19:45+00:00\",\"dateModified\":\"2022-09-04T13:38:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/\"},\"wordCount\":275,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/jharaphula.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png\",\"keywords\":[\"Cache for Offline Storage\",\"Cross Browser\",\"JavaScript Bookmark Function\",\"JavaScript Function\",\"Using HTML5 Application Cache\"],\"articleSection\":[\"JS Functions &amp; Examples\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/\",\"url\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/\",\"name\":\"Cross Browser Compatiable JavaScript Bookmark Function\",\"isPartOf\":{\"@id\":\"https:\/\/jharaphula.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png\",\"datePublished\":\"2016-05-15T15:19:45+00:00\",\"dateModified\":\"2022-09-04T13:38:03+00:00\",\"description\":\"Here I implemented a JavaScript bookmark function. This is cross browser compatible. By simply copy & paste you can easily add bookmarking to a HTML page.\",\"breadcrumb\":{\"@id\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#primaryimage\",\"url\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png\",\"contentUrl\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png\",\"width\":750,\"height\":460,\"caption\":\"Cross Browser Compatiable JavaScript Bookmark Function\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jharaphula.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cross Browser Compatible JavaScript Bookmark Function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jharaphula.com\/#website\",\"url\":\"https:\/\/jharaphula.com\/\",\"name\":\"OneStop Shop\",\"description\":\"Blog for SEO Guest Posting, Digital Marketing or Home Remedies\",\"publisher\":{\"@id\":\"https:\/\/jharaphula.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jharaphula.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jharaphula.com\/#organization\",\"name\":\"OneStop Shop\",\"url\":\"https:\/\/jharaphula.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jharaphula.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2023\/10\/logo.jpg\",\"contentUrl\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2023\/10\/logo.jpg\",\"width\":409,\"height\":91,\"caption\":\"OneStop Shop\"},\"image\":{\"@id\":\"https:\/\/jharaphula.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/tajinweb\",\"https:\/\/x.com\/guestpostingopp\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/jharaphula.com\/#\/schema\/person\/6e9804d6e96ca7218bf968283d69c01b\",\"name\":\"Biswabhusan Panda\",\"description\":\"Biswabhusan is the founder &amp; CEO of JHARAPHULA. Over the last 3 years, he &amp; his team has proved the way to turn blogging into a lucrative career choice. A blog scientist by mind and a passionate blogger by heart. His blog, JHARAPHULA is a platform of various interactive information.\",\"sameAs\":[\"https:\/\/jharaphula.com\",\"https:\/\/www.facebook.com\/panda.biswabhusan\"],\"url\":\"https:\/\/jharaphula.com\/author\/biswabhusan\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cross Browser Compatiable JavaScript Bookmark Function","description":"Here I implemented a JavaScript bookmark function. This is cross browser compatible. By simply copy & paste you can easily add bookmarking to a HTML 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:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/","og_locale":"en_US","og_type":"article","og_title":"Cross Browser Compatiable JavaScript Bookmark Function","og_description":"Here I implemented a JavaScript bookmark function. This is cross browser compatible. By simply copy & paste you can easily add bookmarking to a HTML page.","og_url":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/","og_site_name":"OneStop Shop","article_publisher":"https:\/\/www.facebook.com\/tajinweb","article_author":"https:\/\/www.facebook.com\/panda.biswabhusan","article_published_time":"2016-05-15T15:19:45+00:00","article_modified_time":"2022-09-04T13:38:03+00:00","og_image":[{"width":750,"height":460,"url":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png","type":"image\/png"}],"author":"Biswabhusan Panda","twitter_misc":{"Written by":"Biswabhusan Panda","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#article","isPartOf":{"@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/"},"author":{"name":"Biswabhusan Panda","@id":"https:\/\/jharaphula.com\/#\/schema\/person\/6e9804d6e96ca7218bf968283d69c01b"},"headline":"Cross Browser Compatible JavaScript Bookmark Function","datePublished":"2016-05-15T15:19:45+00:00","dateModified":"2022-09-04T13:38:03+00:00","mainEntityOfPage":{"@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/"},"wordCount":275,"commentCount":0,"publisher":{"@id":"https:\/\/jharaphula.com\/#organization"},"image":{"@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#primaryimage"},"thumbnailUrl":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png","keywords":["Cache for Offline Storage","Cross Browser","JavaScript Bookmark Function","JavaScript Function","Using HTML5 Application Cache"],"articleSection":["JS Functions &amp; Examples"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/","url":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/","name":"Cross Browser Compatiable JavaScript Bookmark Function","isPartOf":{"@id":"https:\/\/jharaphula.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#primaryimage"},"image":{"@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#primaryimage"},"thumbnailUrl":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png","datePublished":"2016-05-15T15:19:45+00:00","dateModified":"2022-09-04T13:38:03+00:00","description":"Here I implemented a JavaScript bookmark function. This is cross browser compatible. By simply copy & paste you can easily add bookmarking to a HTML page.","breadcrumb":{"@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#primaryimage","url":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png","contentUrl":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/top-browsers.png","width":750,"height":460,"caption":"Cross Browser Compatiable JavaScript Bookmark Function"},{"@type":"BreadcrumbList","@id":"https:\/\/jharaphula.com\/cross-browser-javascript-bookmark-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jharaphula.com\/"},{"@type":"ListItem","position":2,"name":"Cross Browser Compatible JavaScript Bookmark Function"}]},{"@type":"WebSite","@id":"https:\/\/jharaphula.com\/#website","url":"https:\/\/jharaphula.com\/","name":"OneStop Shop","description":"Blog for SEO Guest Posting, Digital Marketing or Home Remedies","publisher":{"@id":"https:\/\/jharaphula.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jharaphula.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jharaphula.com\/#organization","name":"OneStop Shop","url":"https:\/\/jharaphula.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jharaphula.com\/#\/schema\/logo\/image\/","url":"https:\/\/jharaphula.com\/wp-content\/uploads\/2023\/10\/logo.jpg","contentUrl":"https:\/\/jharaphula.com\/wp-content\/uploads\/2023\/10\/logo.jpg","width":409,"height":91,"caption":"OneStop Shop"},"image":{"@id":"https:\/\/jharaphula.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/tajinweb","https:\/\/x.com\/guestpostingopp"]},{"@type":"Person","@id":"https:\/\/jharaphula.com\/#\/schema\/person\/6e9804d6e96ca7218bf968283d69c01b","name":"Biswabhusan Panda","description":"Biswabhusan is the founder &amp; CEO of JHARAPHULA. Over the last 3 years, he &amp; his team has proved the way to turn blogging into a lucrative career choice. A blog scientist by mind and a passionate blogger by heart. His blog, JHARAPHULA is a platform of various interactive information.","sameAs":["https:\/\/jharaphula.com","https:\/\/www.facebook.com\/panda.biswabhusan"],"url":"https:\/\/jharaphula.com\/author\/biswabhusan\/"}]}},"_links":{"self":[{"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/posts\/1577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/comments?post=1577"}],"version-history":[{"count":0,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/posts\/1577\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/media\/1894"}],"wp:attachment":[{"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/media?parent=1577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/categories?post=1577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/tags?post=1577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}