Ajax error

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Ajax error

Postby dene@.....ru » Fri Jul 25, 2014 11:51 am

Hi, stan!

During Ajax update shipping methods in console error occurs: Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED. - http://www.figura-plus.com/component/on ... at=raw:330 (line 330 in onepage.js)
This error occurs ONLY when the user is logged, if user is unlogged all works fine.

Image

OPC version - 2.0.250
site - localhost

Thx.
dene@.....ru
 
Posts: 10
Joined: Sat Apr 27, 2013 2:18 pm

Re: Ajax error

Postby admin » Fri Jul 25, 2014 4:25 pm

hello, first of all the locahost is not a real enviroment. this issue can occur, when there are too many ajax requests done at once. it should not cause any specific problems, but we can wrap this into a try/catch block and/or use jquery ajax if available.

best regards, stan, rupostel.com
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Ajax error

Postby dene@.....ru » Sun Jul 27, 2014 7:53 pm

admin wrote:but we can wrap this into a try/catch block and/or use jquery ajax


Very good idea, please do this! I always use jQuery.ajax construct in my project
dene@.....ru
 
Posts: 10
Joined: Sat Apr 27, 2013 2:18 pm

Re: Ajax error

Postby admin » Mon Jul 28, 2014 1:27 pm

hello, we do not really want to depend on jquery because about 40 percent of our customers have a broken jquery issue which happens when any part of the system loads two different jquery libraries, therefore we decided to keep as much compatiblity as possible.

but still we may remake the code to run on jquery once it's found and it's functional. this will be available in version 251.

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Ajax error

Postby admin » Mon Jul 28, 2014 1:50 pm

hello, even when we re-make the code to run on jquery, this issue seems to be caused by google chrome browser's bug on a concurrent ajax requests and according to our tests, it should not cause any sort of harm. this issue will still be shown even when we used jquery.

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Ajax error

Postby dene@.....ru » Mon Jul 28, 2014 3:20 pm

Hi
This issue occurs in FF and IE too.
And which is strange, issue occurs ONLY if user is logged.
dene@.....ru
 
Posts: 10
Joined: Sat Apr 27, 2013 2:18 pm

Re: Ajax error

Postby admin » Mon Jul 28, 2014 11:09 pm

hello, i added the jquery ajax to the latest opc, pls download the very latest version and let us know if you still get the problem.
best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Ajax error

Postby dene@.....ru » Tue Jul 29, 2014 10:28 am

Thx, stan!
It solved the problem!

But, yesterday evening i solved the problem too by adding force call Onepage.op_runSS() to onepage.logged.tpl.php. Remind, that the problem occurs only if user was logged.
After today's update is no longer required. May be... :D
dene@.....ru
 
Posts: 10
Joined: Sat Apr 27, 2013 2:18 pm

Re: Ajax error

Postby admin » Tue Jul 29, 2014 1:55 pm

hello, the new op_runSS should not be needed as it's called on dom ready at the bottom of the onepage.js file. the issue i believe is caused by running more ajax calls at the same time triggered by various platforms at once (mootools/jquery/core js).

i've added the jquery ajax, which has a priority once it is found and working.

i also suggest our vm cart update plugin refered from our extension menu which solves many issues with the core cart add to cart funcionality.

best regards, stan, rupostel.com
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 2