我正在做jQuery自动完成.如果我把硬编码的JSON数组放入工作正常.但是当我从c#传递数组时它失败了.请帮助,我花了足够的时间与它,我被卡住了!
<script type="text/javascript">
$(document).ready(function () {
var msgbox = $("#status");
$.ajax({
type: "POST",
//Page Name (in which the method should be called) and method name
url: "AutoControl.aspx/GetData",
//else If you don't want to pass any value to server side function leave the data to blank line below
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
$("#status").val(msg.d);
}
});
$('#<%=tags.ClientID%>').autocomplete(["c++", "java", "php", "coldfusion"], {
width: 320,
max: 4,
highlight: false,
multiple: true,
multipleSeparator: " ",
scroll: true, …Run Code Online (Sandbox Code Playgroud)