bug:syntaxerror: json.parse: unexpected character at line 1 column 1 of the json data. $(#file-5).fileinput({ language: 'zh', //设置语言 uploadurl: {:u('profile/upload')}, // avatar_uploadyou must set a valid url here else you will get an error __upload__partner/img allowedfileextensions : ['jpg', 'png','gif'], overwriteinitial: false, maxfilesize: 1000, maxfilesnum: 1, //allowedfiletypes: ['image', 'video', 'flash'], slugcallback: function(filename) { alert(aaa); return filename.replace('(', '_').replace(']', '_'); } }) .on(fileuploaded, function (e, data) { var res = data.response; if (res.state > 0) { alert('上传成功'); alert(res.path); } else { alert('上传失败') } });
后台程序我有public function upload(){ }方法,是php的
出错的截图,看着似乎是语法错误,我怀疑是前台fileinput的事件那里出错了,因为后台我只返回一个值做测试,应该没问题的,对fileinput不熟,求助啊!!!谁有例子提供给我参考下也好,谢谢!
回复内容: bug:syntaxerror: json.parse: unexpected character at line 1 column 1 of the json data. $(#file-5).fileinput({ language: 'zh', //设置语言 uploadurl: {:u('profile/upload')}, // avatar_uploadyou must set a valid url here else you will get an error __upload__partner/img allowedfileextensions : ['jpg', 'png','gif'], overwriteinitial: false, maxfilesize: 1000, maxfilesnum: 1, //allowedfiletypes: ['image', 'video', 'flash'], slugcallback: function(filename) { alert(aaa); return filename.replace('(', '_').replace(']', '_'); } }) .on(fileuploaded, function (e, data) { var res = data.response; if (res.state > 0) { alert('上传成功'); alert(res.path); } else { alert('上传失败') } });
后台程序我有public function upload(){ }方法,是php的
出错的截图,看着似乎是语法错误,我怀疑是前台fileinput的事件那里出错了,因为后台我只返回一个值做测试,应该没问题的,对fileinput不熟,求助啊!!!谁有例子提供给我参考下也好,谢谢!