I want to create a bookmark where it will send a parameter from the querystring such as author=John smith which would then be inserted into my rails app, is what I have so far correct? Providing I find out how to get the URL parameters
function updateData(param) {
var myurl = 'http://localhost:3000/app/book';
http.open("GET", myurl + "?author=" + value-of-querystring-param, true);
http.onreadystatechange = useHttpResponse;
http.send(null);
}
That looks like it should work, presuming that useHttpResponse is a handler function.
One thing that you probably should do is encode your parameter:
http.open("GET", myurl + "?author=" + encodeURIComponent(param), true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With