代码是这样的:
<script type="text/javascript">
Ext.onReady(function(){
var form=new Ext.form.FormPanel({
defaultType:'textfield',
labelAlign:'right',
title:'form',
labelWidth:50,
frame:true,
width:220,
url:'index.jsp',
items:[{
fieldLabel:'文本框',
name:'text'
}],
buttons:[{
text:'按钮',
handler:function(){
form.getForm().submit({
success:function(form,action){
Ext.msg.alert('信息',action.result.msg);
},
failure:function(){
Ext.Msg.alert('错误','操作失败!');
}
});
}
}]
});
form.render("form");
});
</script>
  </head>
  
  <body>
    <div id="form"></div>
  </body>点击按钮提交时,页面报错,错误是:
消息: 语法错误
行: 7
字符: 102830
代码: 0
URI: http://localhost:8080/freeerStruts2/extjs/ext-all.js我刚接触ext找了好久都找不到问题所在,那位好心人帮个忙把~~~谢谢了

解决方案 »

  1.   

    url:'index.jsp'
    这个是神马东东
      

  2.   

    var form = new Ext.form.FormPanel(
    {
    labelWidth : 70,
    fileUpload : true,
    frame : true,
    defaultType : 'textfield',
    items : [ {
    xtype : 'textfield',
    fieldLabel : Jer.Global.BUNDLE
    .getMsg("BbhManager.bbhimport.textfield.fieldLabel"),
    name : 'filename',
    fieldLength : 400,
    inputType : 'file',
    allowBlank : false,
    blankText : Jer.Global.BUNDLE
    .getMsg("BbhManager.bbhimport.textfield.blankText")
    } ],
    buttons : [
    {
    text : Jer.Global.BUNDLE.getMsg("CommitButton"),
    handler : function(b, e) {
    var form = b.ownerCt.form;
    if (!form.isValid()) {
    return;
    }
    var userid = Jer.Global.USERID;
    b.ownerCt.form
    .doAction(
    'submit',
    {
    url : 'ExtControllerServlet?action=reportUnitAction.doImport&requestType=file&reportUnitSystemId='
    + o.id
    + '&userid='
    + userid,
    method : 'post',
    // waitMsg :
    // '提交中,请稍等...',
    success : function(
    form, action) {
    Ext.WindowMgr
    .getActive()
    .close();
    Ext.Msg
    .alert(
    Jer.Global.BUNDLE
    .getMsg("Ext.MessageBox.alert.title"),
    action.result.message);
    o.grid.store
    .reload();
    },
    failure : function(
    form, action) {
    Ext.WindowMgr
    .getActive()
    .close();
    Ext.Msg
    .alert(
    Jer.Global.BUNDLE
    .getMsg("Ext.MessageBox.alert.title"),
    action.result.message);
    o.grid.store
    .reload();
    },
    params : {
    userid : userid
    }
    });
    } },
    {
    text : Jer.Global.BUNDLE.getMsg("CancelButton"),
    handler : function(b, e) {
    var win = b.ownerCt.ownerCt;
    win.close();
    }
    } ]
    });我都是这样用的 专门给你整理了一个代码无限堆的。