javascript - Loading arrays through select2 with text containing HTML-entities are not showing as the special characters -
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>test</title> <link rel="stylesheet" type="text/css" href="stylesheet.css" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" rel="stylesheet" /> </head> <body> <div> <select style="width: 50%" id="div"> </select> </div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js"></script> <script type="text/javascript" src="javascript.js"></script> </body>
and in javascript:
$('select').select2(); array = [ { id: 0, text: "μ" }, { id: 1, text: "¢" }, ]; $("#div").select2({ data: array })
the result select option "& m u ; "
, "& c e n t;"
, not "μ"
, "¢"
. have idea how fix this?
i see
array = [ { id: 0, text: "μ" }, { id: 1, text: "¢" },];
you have no problems coding? example of working symbols - http://codepen.io/anon/pen/oxomlp
Comments
Post a Comment