开发者

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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜