如果我打开了Firebug控制台,并在rails控制器中返回以下内容以响应ajax调用:
format.json { render :json => Appointment.find_by_id(1) }
我收到一个无效的标签错误。但它工作得很好,因为萤火虫关闭了。
有什么想法吗???
如果我打开了Firebug控制台,并在rails控制器中返回以下内容以响应ajax调用:
format.json { render :json => Appointment.find_by_id(1) }
我收到一个无效的标签错误。但它工作得很好,因为萤火虫关闭了。
有什么想法吗???
解决问题的办法是:
jQuery.ajaxSetup({
jsonp: null,
jsonpCallback: null
});
问题是浏览器将json视为jsonp,并向其添加回调。
这个命令解决了这个问题(至少对我来说)。
这似乎与使用JQuery1.5有关。您能确认JQuery 1.4.4不会发生这种情况吗?
我同意Tomer的观点,认为这是一个json与jsonp的问题,但他的代码并没有为我修复它。我通过添加以下jQuery代码(适用于1.4和1.6)来修复它:
$(function() {
$.ajaxSetup({
dataType: json
});
});
I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...
I m trying to find a reusable way to set focus from one text box to another upon enter using ASP.NET, but using client-side JavaScript to do so. The only reason I mention this is to be done in ASP....
I have some Javascript JQuery code that does an Ajax call to the server every 5 mins, it s to keep the server session alive and keep the user logged in. I m using $.ajax() method in JQuery. This ...
Why are my AJAX requests failing? I have a website www.foo.com, and I m running Tomcat on the same server, www.foo.com:8080/services. However, when a file on foo.com makes an ajax call as such: $....
I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...
I have a entry form. Below it, I want to show a grid containing existing records. As the user clicks on a row of the grid, the values must get filled in the fields of the form above. Is there any way ...
I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...
Ok, I m stumped. Basically, this script works fine in FF, but not in IE (6,7 or 8) - in which it returns an "Object doesn t support this property or method" error. Any ideas?: function ...