Rapturezone

  • Resources
  • Blog
  • About Us
  • Privacy Policy

Creating Dynamic Bookmark

November 23 by www

How to create a dynamic book mark? This post will go over how to create a bookmark that will resolve to the current date in the URL path.

Create a new bookmark and enter in the code below into the URL field of the bookmark.

javascript:function url() { var date = new Date(); var y = date.getFullYear(); var m = date.getMonth() +1; if(m < 10){m = '0' + m;} var d = date.getDate(); if(d < 10){d = '0' + d;} var date = String(y) + String(m) + String(d); return 'https://docs.google.com/a//forms/d/e/1F874njiAvg/viewform?entry.528742098=' + date + '&entry.5485865554=Start'; } window.open(url(),"_blank");

With this example the Google Form has two inputs, a date(string) and start(string).

So in order to automate the date string part. It is expecting a YYYYMMDD formatted string. This is achieved in JavaScript by

var date = new Date();
var y = date.getFullYear();
var m = date.getMonth() +1; if(m < 10){m = ‘0’ + m;}
var d = date.getDate(); if(d < 10){d = ‘0’ + d;}
var date = String(y) + String(m) + String(d);

Related

  • Fixing FireFox Sorry We’re having trouble getting your pages back

Links

Filed Under: How To Tagged With: HTML

Recent Posts

  • Alternative Android Apps
  • Web Scraping with Python and Beautiful Soup Example IMDB Top 250
  • Web Scraping with Python and Beautiful Soup
  • Pi Pico Mouse Jiggler
  • JellyFin Docker Container

Recent Comments

    Archives

    • September 2021
    • August 2021
    • July 2021
    • January 2021
    • September 2020
    • August 2020
    • June 2020
    • May 2020
    • December 2019
    • November 2019
    • November 2017
    • July 2017
    • January 2017
    • January 2016
    • December 2015
    • September 2015
    • April 2015
    • March 2015
    • November 2014

    Categories

    • Definitions
    • How To
    • Resources
    • Uncategorized

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    Google+

    Copyright © 2025 · eleven40 Pro Theme on Genesis Framework · WordPress · Log in