Is it possible to pass along variables in a JS confirm dialog? Right now, the variables are passing literally instead of their variable values being passed. In this case, the $id variable is not being passed:

Code:
<input type='button' onclick='confirmation()' value='Delete'>
At bottom of page, right above the closing </body> tag:

Code:
<script>
<!--
function confirmation() {
	var answer = confirm("Delete the information? This action cannot be undone.")
	if (answer){
		window.location = "delete.php?id=' . $id . '";
	}
	else{
		window.location = "stay-on-same-page.php";
	}
}
</script>
If I do it this way, with no alert, then the variables are passed just fine:

Code:
<a href='delete.php?id=" . $id . "'> Delete</a>
I like to use the confirm dialog to make sure someone hasn't clicked on the delete function accidentaly.