E
E
Evgeny Ivanov2018-02-01 08:37:10
JavaScript
Evgeny Ivanov, 2018-02-01 08:37:10

How to return ajaxSubmit data?

When using ajaxSubmit ran into some difficulties.
The code doesn't work. Possibly a syntax error. I'm trying to return data to an element with the class main_background. The function is called but no data is returned.
Where is the mistake and how to fix it?

$('.graph_control_settings').on('change', function(){
$("#graph_control_form").ajaxSubmit({url: 'actions.php', type: 'post',success: $('.main_background').html(data)});
return false;
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew Popov, 2018-02-01
@logpol32

success must be represented by an executable function, since it is a callback to the execution of sending data, in other words:
success: function(data){
$('.main_background').html(data);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question