4thSpace
4thSpace

Reputation: 44310

How to refresh page and append URL parameter?

When a certain webpage loads, I'd like to append a URL parameter to the page URL without having to know the full URL path.

I've tried this but it didn't work:

<a href="javascript:location.href?param=1">test link</a>

When I click the link, nothing happens. Any ideas how this can be done?

The above is meant to refresh the page and I can then capture the parameter.

Upvotes: 0

Views: 868

Answers (1)

Musa
Musa

Reputation: 97672

Try

<a href="?param=1">test link</a>

Upvotes: 7

Related Questions