I am making a prototype and I want the search button to link to a sample search results page.
How do I make a button redirect to another page when it is clicked using jQuery.
I am making a prototype and I want the search button to link to a sample search results page. How do I make a button redirect to another page when it is clicked using jQuery. |
||||
|
Without script:
Better yet, since you are just going somewhere, present the user with the standard interface for "just going somewhere":
Although, the context sounds like "Simulate a normal search where the user submits a form", in which case the first option is the way to go. |
|||||||||
|
is this what you mean?
|
|||
|
|
|||
|
With simple Javascript:
|
|||
This should work ..
|
|||
|
You can use window.location
Or you can just make the form that the search button is in have a action of the page you want. |
|||
|
And in Rails 3 with CoffeeScript using unobtrusive JavaScript (UJS): Add to
which reads: when the document.ready event has fired, add an |
|||
|
Wrap it in a link
|
|||
|