谁能帮我把这段js修改下
function getFromField(object, parentFromTableTrType) {
var physicTableId = $(object).parent().prev().children(":eq(2)").val() ;
var physicTableName = $('input:visible', $(object).parent().prev()).val();
if (!$.trim(physicTableName)) {
top.showTipInfo('error');
return false;
}
else {
var id = object.id;
var index = id.substring(id.lastIndexOf("_")+1);
var fromDictTypeName = $('#'+parentFromTableTrType+"_fromDictTypeName_"+index).val();
if ($.trim(fromDictTypeName)) {
return false;
}
else {
var dataType = $('#'+parentFromTableTrType+'_dataType_'+index).val();
if (!$.trim(dataType)) {
top.showTipInfo('ok');
return false;
}
var fromTableId = $('#'+parentFromTableTrType+'_fromTableId_'+index).val();
var getFromFieldUrl = projectBath+"/publicField/getFromFieldList.action?modid="+$("#modid").val()
+"&fromTableId="+fromTableId;
var firstId = object.id;
var secondId = $(object).next().attr("id");
var threeId = $(object).next().next().attr("id");
getFromFieldUrl += "&rtParentSelectedFieldIds="+firstId+","+secondId+","+threeId+'&dataType='+dataType;
top.popUpIFrameLayer(getFromFieldUrl, "字段");
}
}
}
我现在不想要提示'error'的这个判断了,请帮我去掉。不要报错。
------解决方案--------------------直接注释掉不就好了
if (!$.trim(physicTableName)) {
//top.showTipInfo('error');
return false;
}
------解决方案--------------------if (
true
------解决方案--------------------
!$.trim(physicTableName)) {
这样就可以了 以后可以慢慢重构
------解决方案--------------------if (
false && !$.trim(physicTableName)) {
上面写错了 这样
------解决方案--------------------注释掉
if?(!$.trim(physicTableName))?{
//top.showTipInfo('error');
return?true; //返回值由false 改为 true
}
------解决方案-------------------- function getFromField(object, parentFromTableTrType) {
var physicTableId = $(object).pa