避免使用长度超过x个字符的工件 [英] Avoid artifacts with longer than x characters
问题描述
我的代码如下
$ .ajax({
类型:POST,
url:VendorMaster.aspx / SanDocumentData,
data:'{reqvehicleregistrationname:'+ vehicleregistrationname +',reqvehicleregistrationpath:'+ vehicleregistrationpath +'} ',
contentType:application / json; charset = utf-8,
responseType:json,
缓存:false
}
);
从上面的代码中,以下行超出120个字符,如何拆分。
数据:'{reqvehicleregistrationname:'+ vehicleregistrationname +
',reqvehicleregistrationpath:'+ vehicleregistrationpath +'}',
怎么办。
我试过的:
My code as follows
$.ajax({
type: "POST",
url: "VendorMaster.aspx/SanDocumentData",
data: '{reqvehicleregistrationname: "' + vehicleregistrationname + '",reqvehicleregistrationpath:"' + vehicleregistrationpath + '" }',
contentType: "application/json; charset=utf-8",
responseType: "json",
cache: false
}
);
From the above code the below line exceed 120 characters, how to split .
data: '{reqvehicleregistrationname: "' + vehicleregistrationname +
'",reqvehicleregistrationpath: "' + vehicleregistrationpath + '" }',
how to do.
What I have tried:
My code as follows
$.ajax({
type: "POST",
url: "VendorMaster.aspx/SanDocumentData",
data: '{reqvehicleregistrationname: "' + vehicleregistrationname + '",reqvehicleregistrationpath:"' + vehicleregistrationpath + '" }',
contentType: "application/json; charset=utf-8",
responseType: "json",
cache: false
}
);
From the above code the below line exceed 120 characters, how to split .
data: '{reqvehicleregistrationname: "' + vehicleregistrationname +
'",reqvehicleregistrationpath: "' + vehicleregistrationpath + '" }',
how to do.
推荐答案
.ajax({
类型:POST,
url:VendorMaster.aspx / SanDocumentData,
数据:'{reqvehicleregistrationname:' + vehicleregistrationname +',reqvehicleregistrationpath:'+ vehicleregistrationpath +'}',
contentType:application / json; charset = utf-8,
responseType:json,
cache:false
}
) ;
从上面的代码中,下面的行超过120个字符,如何分割。
数据: '{reqvehicleregistrationname:'+ vehicleregistrationname +
',reqvehicleregistrationpath:'+ vehicleregistrationpath +'}',
怎么样做。
我尝试过:
.ajax({
type: "POST",
url: "VendorMaster.aspx/SanDocumentData",
data: '{reqvehicleregistrationname: "' + vehicleregistrationname + '",reqvehicleregistrationpath:"' + vehicleregistrationpath + '" }',
contentType: "application/json; charset=utf-8",
responseType: "json",
cache: false
}
);
From the above code the below line exceed 120 characters, how to split .
data: '{reqvehicleregistrationname: "' + vehicleregistrationname +
'",reqvehicleregistrationpath: "' + vehicleregistrationpath + '" }',
how to do.
What I have tried:
My code as follows
.ajax({
type: POST,
url: VendorMaster.aspx / SanDocumentData,
data:' {reqvehicleregistrationname:' + vehicleregistrationname + ' ,reqvehicleregistrationpath:' + vehicleregistrationpath + ' } ',
contentType: application / json; charset = utf-8,
responseType: json,
cache: false
}
);
从上面的代码中,以下行超过 120 个字符,如何拆分。
数据:' {reqvehicleregistrationname:' + vehicleregistrationname +
' ,reqvehicleregistrationpath:' + vehicleregistrationpath + ' }',
如何执行。
.ajax({ type: "POST", url: "VendorMaster.aspx/SanDocumentData", data: '{reqvehicleregistrationname: "' + vehicleregistrationname + '",reqvehicleregistrationpath:"' + vehicleregistrationpath + '" }', contentType: "application/json; charset=utf-8", responseType: "json", cache: false } ); From the above code the below line exceed 120 characters, how to split . data: '{reqvehicleregistrationname: "' + vehicleregistrationname + '",reqvehicleregistrationpath: "' + vehicleregistrationpath + '" }', how to do.
不要使用这么长的名字。
即使使用单个字符变量,您仍然会查看超过60个字符的字符串:
Don't use such long names.
Even with single character "variables" you are still looking at over 60 characters for your string:
reqvehicleregistrationname: "?",reqvehicleregistrationpath: "?"
因此,几乎任何类型的文件路径都会非常快地超过120个字符。
如果您需要更短的字符串,请缩小内容。这意味着不要将其中大部分用于名称,我担心!
So with pretty much any kind of file path you are going to exceed 120 characters very quickly.
If you need a shorter string, shrink the content. And that means not using most of it for names, I'm afraid!
这篇关于避免使用长度超过x个字符的工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!