Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 获取错误JSON.parse:尝试提交表单时出现意外字符_Jquery_Json_Asp.net Mvc 4 - Fatal编程技术网

Jquery 获取错误JSON.parse:尝试提交表单时出现意外字符

Jquery 获取错误JSON.parse:尝试提交表单时出现意外字符,jquery,json,asp.net-mvc-4,Jquery,Json,Asp.net Mvc 4,输入视频标题并尝试提交表单时,我收到错误“JSON.parse:意外字符”。我无法提交表单。请建议 Firebug在jquery.js文件第541行显示错误 parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { **return window.JSON.parse( data );*

输入视频标题并尝试提交表单时,我收到错误“JSON.parse:意外字符”。我无法提交表单。请建议

Firebug在jquery.js文件第541行显示错误

parseJSON: function( data ) {
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
**return window.JSON.parse( data );**  ---> Here (Line 541)
}
if ( data === null ) {
return data;
} 

@使用(Html.BeginForm(“SaveTrainerVideo”、“Trainer”、FormMethod.Post、新的{@enctype=“multipart/formdata”、@id=“form\u VideoGallery\u Management”}))
上传视频*
请选择要上载的视频文件。
视频标题*
@TextBoxFor(m=>m.VideoTitle,新的{@class=“FitsomEditor”,@style=“width:58%;”})
请输入视频标题。
}
函数SetSaveValues(){
var File=document.getElementById('HasFile').value;
var Title=document.getElementById('VideoTitle')。值;
如果(标题!=“”&文件!=“”){
$(“#showValid”).hide();
$(“#validTitle”).hide();
返回true;
}
否则{
如果(文件==null | |文件==''){
$(“#showValid”).show();
}
否则{
$(“#showValid”).hide();
}
如果(标题==“”){
$(“#validTitle”).show();
}
否则{
$(“#validTitle”).hide();
}
返回false;
}
}
试试这个

parseJSON: function( data ) {
   // Attempt to parse using the native JSON parser first
  if ( window.JSON && window.JSON.parse ) {
  return jQuery.parseJSON(data);
 }
if ( data === null ) {
   return data;
} 
试试这个

parseJSON: function( data ) {
   // Attempt to parse using the native JSON parser first
  if ( window.JSON && window.JSON.parse ) {
  return jQuery.parseJSON(data);
 }
if ( data === null ) {
   return data;
}