hello
By modifying the current code, the result should come out like TO-BE.
How should I modify the TO-BE code?
Hello !
you have to include your AJAX call in the first 'loop' to achieve.
a copy paste will fit.
change the place of the Ajax, put it in the main loop
If [return false] ,Hello !
you have to include your AJAX call in the first 'loop' to achieve.
a copy paste will fit.
change the place of the Ajax, put it in the main loop
$.(#combobox).each(function() {
var stage = $.(this).val();
$.each(ArrayList, function(idx, item) {
$.each(item, function(idx2, item2) {
if(stage == item2.toString()) {
goStraightToAjax();
return false;
} else { // if(false)
break; // break out of 2each loop
}
});
});
});
function goStraightToAjax() {
var argData = {
...
}
$.ajax({
method: 'post',
url: './api/abc.xml'
})
.done(function(data) {
var value = JSON.parse(data);
});
}
If I getting you right, the code should be looks like similar to this ...
JavaScript:$.(#combobox).each(function() { var stage = $.(this).val(); $.each(ArrayList, function(idx, item) { $.each(item, function(idx2, item2) { if(stage == item2.toString()) { goStraightToAjax(); return false; } else { // if(false) break; // break out of 2each loop } }); }); }); function goStraightToAjax() { var argData = { ... } $.ajax({ method: 'post', url: './api/abc.xml' }) .done(function(data) { var value = JSON.parse(data); }); }
Check article on link above.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.