Rails 3 Check if Javascript is enable (serverside)
I found something on stackoverflow that works for prototype but I'm using jquery. Any ideas what I need to call instead?
Check if Javascript is Enabled (Serverside) 开发者_如何学JAVAwith Rails
function confirmJavascript()
{
// Assuming you are using Prototype
new Ajax.Request('/JavascriptController/confirm');
}
If you just want to make an Ajax request to '/JavascriptController/confirm'
, then you would do this:
$.ajax({
url: '/JavascriptController/confirm'
}
});
However, its never going to get sent if Javascript isn't enabled.
More info about making Ajax requests using jQuery is available here: http://api.jquery.com/jQuery.ajax/
精彩评论