Hi I'm doing the following in Javascript after a button click:
do something (1),
Execute the query
do something (2)
If I execute this javascript I see the following execution :
do something (1)
do something (2)
Execute the query
This is the code:
itemToTest0='E120';
alert('Before'); /(1)
haram_query.execute({ / (2)
data:{
'where':{'Ingredient':itemToTest0} // here test first item
},
success:function(data){ // + length= 1
if (data.length===1)
{
alert("Test1: ")
}
else
{
alert("Test2: ")
notharam(itemToTest0); // Call to a function
}
},
error:function ( jqXHR, textStatus, errorThrown ) {
alert("error1!!!");
}
,headers:{}
});alert('after'); / (3)