Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 173633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:22:40+00:00 2026-05-11T13:22:40+00:00

If I load this in a new tab (FF3) it works. If I load

  • 0

If I load this in a new tab (FF3) it works. If I load it in the current tab it just prints the url.

I think it’s actually a matter of loading it in an existing gmail tab. So say, make the bookmarklet, click it once, then click it again. That seems to be the way to recreate the problem.

Any idea what would cause this? I can think of a few workarounds, but I’m curious about how this works.

javascript:var%20t=new%20Date(),y=t.getFullYear(),m=t.getMonth()+1,d=t.getDate();document.location.href='http://mail.google.com/mail/#search/is%3Aunread+after%3A'+y+'-'+m+'-'+d  /* same code split up for readability */ javascript:   var t = new Date(),       y = t.getFullYear(),       m = t.getMonth()+1,    /* d = t.getDay(); I actually have this correct above, but not here.. oops */       d = t.getDate();    document.location.href='http://mail.google.com/mail/#search/is%3Aunread+after%3A'+y+'-'+m+'-'+d; 

Any help?

Thanks 🙂

UPDATE:

when I remove the extra whitespace from this answer and covert the necessary spaces to ‘%20’ (url encoding), it does nothing at all:

 /* this works. I was missing the final ')' altCognito wrote */  javascript:void((function(){var%20t=%20new%20Date(),y=t.getFullYear(),m=t.getMonth()+1,d=t.getDate();window.location.href='http://mail.google.com/mail/#search/is%3Aunread+after%3A'+y+'-'+m+'-'+d;})()) 

I also experimented with some semicolon fiddling and other general syntax checks, but I’m not sure what I’m looking for. It works neither as a bookmarklet or when pasted straight into the address bar (for me anyway).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:22:41+00:00Added an answer on May 11, 2026 at 1:22 pm

    What you want is something that looks like this:

    javascript:void(     (function() {     var t = new Date(),           y = t.getFullYear(),           m = t.getMonth()+1,           d = t.getDate();       window.location.href='http://mail.google.com/mail/#search/is%3Aunread+after%3A'+y+'-'+m+'-'+d;     })() ) 

    The key is the void((function() {… Your stuff here … })())

    Note, that you also want to use getDate(), not getDay, as getDay returns the day of the week!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am new kernel programming.i have been trying to load this driver program for
I am new at this :) I am trying to load a picture from
Hi i have a code like this: $doc = new DOMDocument(); $doc->Load('courses.xml'); foreach ($doc->getElementsByTagName('courses')
I am new to php and I am getting this error trying to load
I use a JavaScript to load new pages on my webpagepage. looks like this:
Part of my code goes like this: while(1){ my $winmm = new Win32::MediaPlayer; $winmm->load('1.mp3');
I've just created a simple bookmarklet to load a URL containing a generated string.
Normally, this combination opens a link as a new tab in Chrome, Firefox, and
Should this work? <script type=text/javascript> function load_i () { img = new Image(); img.onload
I am trying to load this javascript externally, but it seems to not be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.