I have a JavaScript function that works fine in Chrome but not in IE.
<script type="text/javascript">
function save () {
$.ajax({
url: 'somepage.aspx',
data: {
cmd: "add",
},
type: 'POST',
async: true,
cache: false,
success: function (data, textStatus, xhr) {
// somelogic
}
});
}
</script>
It works in Chrome, but gives an error in IE:
SCRIPT257: Could not complete the operation due to error 80020101.
jquery-1.7.1.min.js, line 2 character 11497
Thank you in advance.
I forgot to delete the comma after "cmd: add", I had several variables in data data:{ cmd:"add", itemId: $("#someInputId").val(),anotherId: $("#someInputId2").val()} Edited:
<script type="text/javascript">
function save () {
$.ajax({
url: 'somepage.aspx',
data: {
cmd:"add",
itemId: $("#someInputId").val(),
anotherId: $("#someInputId2").val()
},
type: 'POST',
async: true,
cache: false,
success: function (data, textStatus, xhr) {
// somelogic
}
});
}
</script>