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

[eluser]Narkboy[/eluser]
I have a strange side effect occuring which is bugging me. Everything works, most of the time...

Basically:

An AJAX call changes an entry in my config file via fwrite. When that returns a success, it refreshes the 'status' section of the page.

The status section displays the current status based on that config entry.

However, the status fetched by the FIRST refresh call always shows the old config value. The second one usually shows the new value, and the third one always does. It's pretty rare I need a third call (maybe 1 in 100 calls fails on both the first and second call).

I'm using a workaround whereby the AJAX call to refresh the status is always done twice, but I need to understand why this is happening.

So - running order:

Ajax Update Call - updates the config value, and returns a success notice.

1st Ajax Refresh Call - checks the config var and returns the OLD value.

2nd Ajax Refresh Call - checks tthe config var and returns the NEW value (mostly).

Both refresh calls are identical, as is the 3rd if it's needed.



I had thought that the refresh call was coming too close after the update call, but it's only actually requested after the update returns a success notice, by which time the model has finished changing the config file.

Any thoughts?

- Can post the code, but it all works and, well, there's a lot of it!

Smile


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