开发者

Is this a valid url parameter in jquery.ajax()?

开发者 https://www.devze.com 2022-12-26 08:09 出处:网络
Is thi开发者_开发问答s a valid url parameter in jquery.ajax(), <script type=\"text/javascript\">

Is thi开发者_开发问答s a valid url parameter in jquery.ajax(),

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

The url doesn't seem to go to my controller function...


Try setting async to true. Also, what does Firebug say?

Always use Firebug to see what's actually going on.

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


You're using something like mod_rewrite I asume. You should use a direct url (http://www.example.nl/page.php) I meant it is allowed to use get variables in your url...


in your url try just function name url:"main"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号