$(document)...">

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

Is this 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 fit my controller function ...

+3
source share
3 answers

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

Always use Firebug to find out what's really going on.

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

+1
source

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

+1

URL- URL: ""

+1

Source: https://habr.com/ru/post/1739957/


All Articles