typeahead.js - Twitter bootstrap typeahead does not work properly with data-source attribute -
why when use " sign in data-source attribute denote string values works when use ' denote them bootstrap recognizing first character?
i know in c# , many other language difference between " , ' difference between character , string first time see strictly used in html case here if why isn't there error in js.
<div class="container"> <div class="hero-unit"> <form> <div> <label>working typeahead</label> <input type="text" data-provide="typeahead" autocomplete="off" data-source='["hello","world"]' /> </div> <div> <label>not working typeahead</label> <input type="text" data-provide="typeahead" autocomplete="off" data-source="['hello','world']" /> </div> </form> </div> see fiddle: http://jsfiddle.net/h4qmh/4/
that weird, data-source=["hello", "world"] works, doesn't clean html.
i'm wondering if being treated json, in case elements must wrapped in double-quotes. see: how pass array jquery .data() attribute.
Comments
Post a Comment