这是jquery.ajax()中的有效url参数吗?

时间:2010-04-06 07:52:12

标签: php jquery ajax url codeigniter

这是jquery.ajax()中的有效url参数,

<script type="text/javascript">
   $(document).ready(function() {
    getRecordspage();
  });

  function getRecordspage() {
    $.ajax({
        type: "POST",
        url: "http://localhost/codeigniter_cup_myth/index.php/adminController/mainAccount",
        data: "",
        contentType: "application/json; charset=utf-8",
        global:false,
        async: false,
        dataType: "json",
        success: function(jsonObj) {
           alert(jsonobj);
        }
    });
}
 </script>

网址似乎没有进入我的控制器功能...

3 个答案:

答案 0 :(得分:1)

我正在使用像mod_rewrite这样的东西。您应该使用直接网址(http://www.example.nl/page.php)我的意思是允许您在网址中使用获取变量...

答案 1 :(得分:1)

在您的网址中

尝试只是函数名称 URL: “主”

答案 2 :(得分:1)

尝试将异步设置为true。另外,Firebug说了什么?

始终使用Firebug查看实际情况。

https://addons.mozilla.org/en-US/firefox/images/p/11828/

相关问题