I have the following line of javascript:
...
var refundVal = $( ".refundVal" ).val();
var dt={
orderId:orderId,
refundVal:refundVal,
process:btnProcess
};
window.srObjc.confirm("message $"+refundVal+" ?").promise.done(function(dt)
{
console.log("test0"); //L1
console.log(dt); //L1
console.log("test1"); //L1
console.log(refundVal);//L4
//Ajax
var request =$.ajax({
url: "pagamentos.php",
type: "POST",
data: dt,
dataType: "json"
});
request.done(function(dataset){
var resut = dataset;
var str = JSON.stringify(resut, null, 2);
alert(str);//test
container.html(render(resut));
$('#raw-data').html(syntaxHighlight(str));
console.log(str);//test
});
}//window.srObjc.confirm
In this example the value refundVal is equal to $ 1.
This is the result in console.log:
Thevalueof"dt" is showing "ok". I expected to see an object with values in the doconsole log.
And the value of refund val is correct = $ 1, and I was not expecting this since I'm not sending this value in the parameter of the promise.done(function(dt)
function.
So the question is how do I send this object into the function and see the correct display in console.log?