代码之家  ›  专栏  ›  技术社区  ›  Jeaf Gilbert

ExtJS Ajax调用

  •  2
  • Jeaf Gilbert  · 技术社区  · 14 年前

    新手问:

    我错过什么了吗?

    加载的脚本

    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";

    Firebug错误

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

    Chrome错误

    Uncaught TypeError: Cannot call method 'indexOf' of undefined

    (=)

    更新/固定

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

    1 回复  |  直到 11 年前
        1
  •  4
  •   Jeaf Gilbert    14 年前

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