[RSS Feed/News] ajax:complete & window.location.href

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
EDIT: Moved to proper forum

On my dev site I have a template with two forms and JS. The second form does a redirect after the form submits and some ajax stuff happens

Code:

Code:
$(document).on('ajax:complete', function(event, xhr, settings){
    var parts = jQuery.parseJSON(xhr.responseText);
    if(parts['status'] != 'ok'){
        if('cartUrl' in parts){
            window.location.href = '/store/cart.php?target=cart&action=add&product_id='+parts['cartUrl'];

Everything works as it...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom