Hi all,
I've got a nice piece of javascript
<script type="text/javascript"><!--
var d = new Date();
d.setTime(d.getTime()-86400*1000);
window.location = "https://mail.google.com/mail/?shva=1#search/in%3Ainbox+before%3A"+(d.getYear()+1900)+"%2F"+(d.getMonth()+1)+"%2F"+d.getDate();
//-->
</script>
That works entirely satisfactorily when I visit the .html file that i store the javascript in.
However, I'd like to get the same effect from using a bookmarklet - however, when I put
javascript:var%20d%20=%20new%20Date();%20d.setTime(d.getTime()-86400*1000);%20window.location%20=%20"https://mail.google.com/mail/?shva=1#search/in%3Ainbox+before%3A"+(d.getYear()+1900)+"%2F"+(d.getMonth()+1)+"%2F"+d.getDate();
into my bookmark I'm taken to re:2010/4/20 rather than re%3A2010%2F4%2F20
I'm assuming that there's some problem with the escape characters in either the bookmarking system or javascript but I'm not getting anywhere - anyone care to lend a hand?
Joe