日期:2014-05-20  浏览次数:20819 次

这JS文件里写的是什么?
JS文件里写的如下(就跟CSS似的):  
  form :

title : 'Form Properties',
menu : 'Form Properties',
action : 'Action',
method : 'Method',
encoding : 'Encoding',
target : 'Target',
targetNotSet : '<not set>',
targetNew : 'New Window (_blank)',
targetTop : 'Topmost Window (_top)',
targetSelf : 'Same Window (_self)',
targetParent : 'Parent Window (_parent)'
},
table :
{
toolbar : 'Table',
title : 'Table Properties',
menu : 'Table Properties',
deleteTable : 'Delete Table',
rows : 'Rows',
columns : 'Columns',
border : 'Border size',
align : 'Alignment',
alignNotSet : '<Not set>',
alignLeft : 'Left',
alignCenter : 'Centre',
alignRight : 'Right',
width : 'Width',
widthPx : 'pixels',
widthPc : 'percent',
height : 'Height',
cellSpace : 'Cell spacing',
cellPad : 'Cell padding',
caption : 'Caption',
summary : 'Summary',
headers : 'Headers',
headersNone : 'None',
headersColumn : 'First column',
headersRow : 'First Row',
headersBoth : 'Both',
invalidRows : 'Number of rows must be a number greater than 0.',
invalidCols : 'Number of columns must be a number greater than 0.',
invalidBorder : 'Border size must be a number.',
invalidWidth : 'Table width must be a number.',
invalidHeight : 'Table height must be a number.',
invalidCellSpacing : 'Cell spacing must be a number.',
invalidCellPadding : 'Cell padding must be a number.',

cell :
{
menu : 'Cell',
insertBefore : 'Insert Cell Before',
insertAfter : 'Insert Cell After',
deleteCell : 'Delete Cells',
merge : 'Merge Cells',
mergeRight : 'Merge Right',
mergeDown : 'Merge Down',
splitHorizontal : 'Split Cell Horizontally',
splitVertical : 'Split Cell Vertically',
title : 'Cell Properties',
cellType : 'Cell Type',
rowSpan : 'Rows Span',
colSpan : 'Columns Span',
wordWrap : 'Word Wrap',
hAlign : 'Horizontal Alignment',
vAlign : 'Vertical Alignment',
alignTop : 'Top',
alignMiddle : 'Middle',
alignBottom : 'Bottom',
alignBaseline : 'Baseline',
bgColor : 'Background Color',
borderColor : 'Border Color',
data : 'Data',
header : 'Header',
yes : 'Yes',
no : 'No',
invalidWidth : 'Cell width must be a number.',
invalidHeight : 'Cell height must be a number.',
invalidRowSpan : 'Rows span must be a whole number.',
invalidColSpan : 'Columns span must be a whole number.'
},

row :
{
menu : 'Row',
insertBefore : 'Insert Row Before',
insertAfter : 'Insert Row After',
deleteRow : 'Delete Rows'
},

column :
{
menu : 'Column',
insertBefore : 'Insert Column Before',
insertAfter : 'Insert Column After',
deleteColumn : 'Delete Columns'
}
},
textfield :
{
title : 'Text Field Properties',
name : 'Name',
value : 'Value',
charWidth : 'Character Width',
maxChars : 'Maximum Characters',
type : 'Type',
typeText : 'Text',
typePass : 'Password'
},

如上所写的在JS文件里,可是不知道这都是些啥,为什么这样些,有什么用,不过我试了一下,好像对前台页面的一些设计和影响。请大家指导,谢谢!

------解决方案--------------------
这种格式叫JSON,你可以去搜索下,映射到后台就是实体类
现在很多js框架都这样设计,用来描述一个对象的属性和方法