2010-11-02 73 views
2

新手问:ExtJS阿贾克斯呼叫

我错过了什么吗?

加载的脚本

http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js http://extjs.cachefly.net/ext-3.2.1/ext-all.js

代码

Ext.onReady(function() { 
    Ext.Ajax.request({ 
     method: 'GET', 
     url: '<?php $template_url."/raw-post.php" ?>', 
     params: { Xc : 0, Xp : <?php echo '84'; ?> }, 
     success: function(result, request){ 
      Ext.get('test').dom.innerHTML = result.responseText; 
     } 
    }); 
}); 

原始post.php中

echo "this is response text";

萤火虫错误

e is undefined; window.undefined=window.undefined;Ext=...window.attachEvent("onunload",a)}})();

铬错误

Uncaught TypeError: Cannot call method 'indexOf' of undefined

================== =

更新/修正

对不起,我的坏。我错过了echo这里url: '<?php $template_url."/raw-post.php" ?>',

回答

4

我错过echo这里url: '<?php $template_url."/raw-post.php" ?>',