add date into url as parameter

I have the following script that redirects a user to a web site.
I need to add yesterday's date to the end as paramater txtStartDate, i format 03/04/2014.  This way, each time someone clicks the link, the resulting page is already filtered for them.

<script type="text/javascript">
window.location.href = ""
Who is Participating?
Big MontySenior Web Developer / CEO of Commented:
of course, to format it, you'll need to come up with some code for that as well:

<script type="text/javascript">
function getTommorrowsDate() {
var newDate = new Date() - 1;
var dd = newDate;
var mm = newDate.getMonth();

var yyyy = newDate.getFullYear();
if( dd< 10){ dd='0'+dd }
if( mm < 10){ mm='0'+mm }
return = mm+'/'+dd+'/'+yyyy;

window.location.href = "" + getTommorrowsDate()

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.