how to call variable or property inside an object in javascript or jquery -


i getting dates(start , end dates) dynamically servers in json format, need implement in bootstrap date picker, not working here code note: implementing using variables names

// var start = obj1.start; // var end = obj1.end; var start = 01/02/1906; var end = 01/02/1998;  $('#datepicker').datepicker({     autoclose: true,     startdate: 'start',     enddate: 'end', }); 

the quotes ' or " around variables make them strings, not variable reverence. remove them quotes.

but on other hand, have add quotes on variable declaration, because these strings.

// add quotes here var start = '01/02/1906'; var end = '01/02/1998';  $('#datepicker').datepicker({     autoclose: true,      // , remove quotes here     startdate: start,     enddate: end, }); 

working example.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -