我在 Jquery 中有一个变量,我在单击按钮时为其赋值。现在成功执行代码后,我想让变量为空。
$("#btnAdd").click(function () {
var myDataVariable= {};
myDataVariable.dataOne="SomeData";
myDataVariable.dataTwo="SomeData";
myDataVariable.dataThree="SomeData";
//Pass the value to Database
$.ajax({
success: function (data) {
//If Successfully Inserted Data I want to make "myDataVariable" Null
}
});
});