New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

跨域ajax请求时候报错 #151

boyzhou99 opened this Issue Aug 5, 2014 · 1 comment


None yet
2 participants
Copy link

boyzhou99 commented Aug 5, 2014

emailremote: function(element){
return $.ajax({
url: '',
jsonp: "jsonp_callback",
dataType: 'jsonp',
success: function(success){
fields: {
'user[email]': {
rule: 'emailremote;'..........

当自定义ajax 时候 通过jsonp 跨域请求时候会报错 chrome 下Uncaught TypeError: Cannot read property 'charAt' of undefined
firefox 下报错为 TypeError: c is undefined


This comment has been minimized.

Copy link

boyzhou99 commented Aug 5, 2014

发现nice 只做了json 判断 对于jsonp 没有判断
nice.js 加入判断就好了
// detect if it is json format
if (this.dataType === 'json') {
data = d;
}else if (this.dataType === 'jsonp'){
data = d;
} else if (data.charAt(0) === '{') {
data = $.parseJSON(data) || {};

@niceue niceue closed this in 97cec70 Aug 5, 2014

niceue added a commit that referenced this issue Aug 5, 2014

@niceue niceue added the bug label Aug 7, 2014

@niceue niceue added this to the 0.8.0 milestone Aug 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment