Forum Moderators: open
I know I can do this.
<form action="" onSubmit="return sendURI(this.q.value);">
<input type="text" name="q">
</form>
<script type="text/javascript">
function sendURI(val) {
var uri = '/some-uri/' + val;
document.location=uri;
return false;
}
</script>
Does anyone know a way to do that without Javascript, and without doing a server-side redirect?
- enter "search term" into form
- resulting URI is /some-uri/search-term
Probably not, with a shot . . .
Using the above, I can now get /results/keyword-rich, and the pages are unique. But of course, JS isn't executed by S.E.'s.
So I'm introducing links to these areas
/results/some-keyword
/results/some-other-keyword
which gives something to the S.E.'s. The form still works without JS, but you get either an ugly query string with get, or the same URL for all searches with post.
It's a stupid question, I know, and probably know the answer, but hoping someone has an idea.
JS isn't executed by S.E.'s.
True, but JS or not the S.E.'s are not going to submit the form data.
So I'm introducing links to these areas
/results/some-keyword
/results/some-other-keyword
Ugly links would arguably work as well here
/results?q=some-keyword
/results?q=some-other-keyword
Indeed replacing 'q' with something specific like brand=... may be a plus.
Look at what you consider ugly in the get request, and turn it into semantic gold for the S.E's ?