Welcome Guest, Not a member yet? Register   Sign In
Config updates via jQuery
#4

[eluser]Narkboy[/eluser]
Right - I've had to work on someother things and just come back to this - still the same problem.

It's not a caching issue - that's confirmed.

Here's the javascript that launches the update:
Code:
[removed]
    function check_status() {
            $('#status_holder').load('/admin/cp_ajax/status_return_status');
            $('#status_actions').load('/admin/cp_ajax/status_return_actions');
    };

    $(document).ready(function() {
        $('#do_refresh').click(function () { check_status(); });
        $('#do_maintenance').click(function () { $.ajax( { url: '/admin/cp_ajax/status_change_mode/maintenance' , success: check_status() , cache: 'false' } ); });
        $('#do_testing').click(function () { $.ajax( { url: '/admin/cp_ajax/status_change_mode/testing' , success: check_status() , cache: 'false' } ); });
        $('#do_online').click(function () { $.ajax( { url: '/admin/cp_ajax/status_change_mode/online' , success: check_status() , cache: 'false' } ); });

    });
[removed]

According to Firebug, when you click any of the updatelinks, the ajax calls in check_status() are artucally laaunched first - even though check_status() is called from the 'success' event in the update call.

Basically - we check the status, then update it.

I'm not sure if this is a jQuery problem or Firebug reporting the ajax requests incorrectly, but it would seem not the later as the result matches the order in which Firebug reports the requests.

Anyone else seen this?

Success calls *should* only be made once the original AJAX call is completed; how on earth are the status checks going ahead before the update call is completed?

Driving me nuts.

Help!!


Messages In This Thread
Config updates via jQuery - by El Forum - 10-29-2010, 10:14 AM
Config updates via jQuery - by El Forum - 10-29-2010, 12:26 PM
Config updates via jQuery - by El Forum - 11-09-2010, 02:31 AM
Config updates via jQuery - by El Forum - 11-23-2010, 11:39 AM
Config updates via jQuery - by El Forum - 11-23-2010, 11:50 AM
Config updates via jQuery - by El Forum - 11-23-2010, 12:18 PM
Config updates via jQuery - by El Forum - 11-23-2010, 03:05 PM
Config updates via jQuery - by El Forum - 11-24-2010, 03:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB