Search code examples
phpjavascriptgetappendepoch

append epoch time to a url


Hi I'm trying to append the current epoch time to a url, so onclick it would get a page from the url structured as the following :

http://example.com/grab.php?ans_id=value1&d=epoch time

So for example:

http://example.com/grab.php?ans_id=254&d=1308264776271

I can get the epoch time generated in javascript but cant get it appended to the url :(

any help is appreciated


Solution

  • Here is an example. It takes the href of the link you click on, adds the current epoch stamp and sends you to that page.

    JSFiddle