Click here to Skip to main content
16,017,638 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Uncaught Error: Syntax error, unrecognized expression: #[object Object], what kind of error this please answer me.

This is the code...
JavaScript
<script type=text/javascript>
  function Cascading(parentddl, childddl, controllername, actionname, isaddempty) {
    $('#'+parentddl).val().live('change', function () {
      var idModel = $(this).val().toString();

      $.getJSON("/" + controllername + "/" + actionname, { id: idModel },
        function (ddlData) {
          var selectvalue = $('#'+childddl);
          selectvalue.empty();
          var ds = selectvalue.data().kendoDropDownList.dataSource;
          selectvalue.data(kendoDropDownList").dataSource.data([]);
          selectvalue.val().data("kendoDropDownList").text();
          $.each(ddlData, function (index, itemData) {
          selectvalue.data(kendoDropDownList").dataSource.add({ text: itemData.Text, value: itemData.Value });
        });
      });
    });
  }
</script>
Posted
Updated 19-Nov-13 2:11am
v3
Comments
♥…ЯҠ…♥ 19-Nov-13 7:36am    
can you post your jquery code? think you are just referring undefined object....
ZurdoDev 19-Nov-13 7:39am    
It's a syntax error.
♥…ЯҠ…♥ 19-Nov-13 8:13am    
what you get in selectvalue?

1 solution

You have to unenclosed quotes

here
JavaScript
selectvalue.data(kendoDropDownList").dataSource.data([]);

and here
JavaScript
selectvalue.data(kendoDropDownList").dataSource.add({ text: itemData.Text, value: itemData.Value });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900