I'm trying to populate a RadComboBox but I'm getting this error and I don't know why.
My RadComboBox:
<telerik:RadComboBox ID="regTypeComboBox" runat="server" Width="305" Skin="Telerik" OnClientLoad="OnClientLoadHandler" />
My js:
function OnClientLoadHandler(sender) {
var combo;
combo = sender;
var serviceUrl = "myUrl";
var paramData = {
};
$.ajax({
type: 'GET',
url: serviceUrl,
contentType: 'application/json; charset=utf-8',
crossDomain: true,
data: JSON.stringify(paramData),
dataType: 'json',
success: function (response) {
var listData = response.listData;
$.each(listData, function (index, element) {
var name, id;
name = element.NAME;
id = element.ID;
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(name); // --> SyntaxError: illegal character
//comboItem.set_text("name"); // --> also SyntaxError: illegal character
//comboItem.set_text(""); // --> also SyntaxError: illegal character
});
},
error: function () {
alert("error");
}
});
}
It is pretty simple, but I don't know why it gives this error.
Any ideas? Thanks