Welcome Guest, Not a member yet? Register   Sign In
AJAX in CI3
#3

Code:
<!-- jQuery baseUrl -->
    <script>
        var baseUrl = "<?php echo base_url(); ?>";
    </script>

You need this line in your html head section to get your sites base url.

Code:
$.ajax({
    type    : "POST",
    url     : baseUrl + "menu/menuSave",

Then the Ajax url will look like above, "controller/method"

If you miss spell a property in jQuery it can cause it to error on you simple little things.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
AJAX in CI3 - by Ivo Miranda - 09-02-2016, 04:36 AM
RE: AJAX in CI3 - by PaulD - 09-02-2016, 04:43 AM
RE: AJAX in CI3 - by InsiteFX - 09-02-2016, 08:14 AM
RE: AJAX in CI3 - by rtenny - 09-02-2016, 08:48 AM
RE: AJAX in CI3 - by InsiteFX - 09-03-2016, 05:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB