Reload page with different URL variable

Hi All,

I know I can make a link that reloads a page like this:

<a href=“thispage.php”>Refresh this page</a>
Or, using javascript:
<a href=“javascript:location.reload(true)”>Refresh this page</a>

I am starting from “thispage.php”, and I want to reload it as “thispage.php?action=newversion”? (This page has a form that reloads the rest of the page with new data when refreshed with the action call).

Is there a javascript technique that would do this without calling the “thispage.php” part? The page includes a function that I need to be portable to any page that I place it on.

Obviously this is very wrong but I am trying to do this:

<a href=“javascript:location.reload(true) . ?action=newversion”>Refresh this page</a>

Trying giving this ago:

// Get the current page
var curr_page = window.location.href,
    next_page = "";

// If current page has a query string, append action to the end of the query string, else
// create our query string
if(curr_page.indexOf("?") > -1) {
    next_page = curr_page+"&action=someaction";
} else {
    next_page = curr_page+"?action=someaction";
}

// Redirect to next page
window.location = next_page;

Cool! will try…