This should work.
```
function getQueryParams() {
	var qs = window.location.search.substring(1);
	var options = {};
	var params = qs.split('&');
	for ( i in params) {
		var param = params[i];
		var keyValuePair = param.split('=');
		if (keyValuePair.length > 1) {
			options[keyValuePair[0]] = decodeURIComponent(keyValuePair[1].replace(/\+/g, ' '));
		}
	}
	return options;
}
```

I don't think you should clear the query string if the project wasn't loaded.  Leaving it there shouldn't hurt anything. Do you have to replace the entire query string when project is created/loaded?  It'd be better if you didn't but for now you can leave it how it is.