0
我想使用跨域检查的getJSON()方法我在控制器问题在jQuery.getJSON在导轨2.3.5
def unique_email
count = User.count(:all, :conditions => ['email = ?',params[:email]])
result = Hash.new()
if count > 0
result[:text] = "false"
else
result[:text] = "true"
end
respond_to do |format|
format.json {
render :json => result
}
end
使用以下
<script> jQuery.getJSON("http://localhost:3003/home/unique_email/[email protected]&callback=result", { format: "jsonp" }, function(result) { alert(result.text) }); </script>
结束
我在同一个域中获得警报,这意味着我在我的应用程序中获得了警报,但是在将代码放在应用程序旁边意味着我不是得到任何错误,但应用程序操作被称为..但我没有得到任何来自应用程序的响应。
任何帮助将不胜感激。
感谢&问候,
Ramanavel Selvaraju。