送信するとfirebugコンソールでjsエラーをスローするextjsパネルコンポーネントがあります。私は言います
'You're trying to decode an invalid JSON String: <html>
... index.php html code here
</html><!-- use login javascript file --> <!--<script type="text/javascript" src="http://localhost:9808/recorder/js/login.js"></script>-->
<script type="text/javascript">
login = true;
</script>
<div id="login_window"> </div>' when calling method:
[nsIDOMEventListener::handleEvent]
興味深いのは、htmlコードが「html」タグの後に追加のhtmlと連結されることです。そして、jsonの代わりにindex.phphtmlコードを取得します。check()関数を知っている限り、ecoesはjsonデータのみを呼び出します。
私のコンポーネントコードはこんな感じです
login_group_combo = Ext.create('Ext.form.ComboBox',
{
name: 'combo_name',
id: 'combo_id',
fieldLabel: text_label,
editable: false,
//possible view options
store: [
],
listeners:
{
focus: function(elem, e)
{
function1();
}
}
});
function1()は次のようになります
function function1(){
form1.submit({
url: './index.php/mypage/check',
success: function(f,a){
// some code here
echo json_encode($result_array);
},
failure: function(form, action){
switch (action.failureType) {
case Ext.form.action.Action.CLIENT_INVALID:
Ext.Msg.alert('Failure', 'Invalid data entered!');
break;
case Ext.form.action.Action.CONNECT_FAILURE:
Ext.Msg.alert('Failure', 'Ajax communication failed');
break;
case Ext.form.action.Action.SERVER_INVALID:
Ext.Msg.alert('Failure', action.result.msg);
}
}
});
}
興味深いのは、実行がfunction1()に入るということです。ただし、form1、success、またはfaulireブロックには入力しません。何が問題なのですか?