duanjiu4498 2010-11-02 01:50
浏览 77
已采纳

ExtJS Ajax调用

Newbie ask:

Did I miss something?

Loaded scripts

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

Code

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;
        }
    });
});

raw-post.php

echo "this is response text";

Firebug error

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

Chrome error

Uncaught TypeError: Cannot call method 'indexOf' of undefined

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

Updated/Fixed

Sorry, my bad. I missed echo here url: '<?php $template_url."/raw-post.php" ?>',

  • 写回答

1条回答 默认 最新

  • doubi4531 2010-11-02 02:00
    关注

    I missed echo here url: '<?php $template_url."/raw-post.php" ?>',

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?