I'm getting the following error: missing : after property id in line
data:{$("#msgForm").serialize() + "&field=msg_from"}
The code looks like the following:
$("#msg_from").autocomplete({
source:
function (req, resp){
$.ajax({
url: "autocompl.asp",
data:{$("#msgForm").serialize() + "&field=msg_from"}
});
}
});
Any clue?
in your case it should be:
data: $("#msgForm").serialize() + "&field=msg_from"
in other cases, when using {}
, you also need a key:
data: {'something': $("#msgForm").serialize() + "&field=msg_from"}
Remove the {
and }
from that line:
$("#msg_from").autocomplete({
source:
function (req, resp){
$.ajax({
url: "autocompl.asp",
data: $("#msgForm").serialize() + "&field=msg_from"
});
}
});
The {}
in data: {}
is interpreted as object literal, not a code block (terminology?). Object literals are in the form { id: property }
, hence the error message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With