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

Out of an old tab, i'm opening a new tab in my django-powered web-app.
EDIT: This question was initially too general, I think. So What I really need
This is surely a basic question, but I'm new enough to MVC (and ASP.NET)
I have two actionlinks on my MVC view like this: <%= Html.ActionLink (click me,Partial1,Temp,new
Preface : I am new to the iPhone SDK, Obj-C, Interface Builder and Cocoa.
Note: this is a different problem to https - it's related to privacy security
This might be basic question, however I am confused on some .Net Concpets. I
My problem is the following: In my javascript, I load an XML document from
On my GetBusiness.aspx page i have create a test list List<string> l = new
I'm presenting a simple animation using img.src replace and the <canvas> tag. At present

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.