页面:
- HTML code
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>04.form</title> <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" /> <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script> <script type="text/javascript" src="../../ext-all.js"></script> <script type="text/javascript"> Ext.onReady(function(){ var store = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({url:'1.txt'}), reader: new Ext.data.ArrayReader({}, [ {name: 'value'}, {name: 'text'} ]) }); var combo = new Ext.form.ComboBox({ store: store, emptyText: '请选择', mode: 'remote', triggerAction: 'all', valueField: 'value', displayField: 'text', applyTo: 'combo' }); }); </script> </head> <body> <br /><br /><br /> <input id="combo" type="text"/> </body> </html>
1.txt文件:
- HTML code
[ ['value1','text1w汉字'], ['value11','显示汉字'], ['value111','text111'], ['value1111','text1111'], ['value11111','text11111'], ['value2','text2'], ['value22','text22'], ['value222','text222'], ['value2222','text2222'], ['value22222','text22222汉字'] ]
------解决方案--------------------
1.txt文件本身的编码改成UTF-8的。 用记事本打开1.txt, 菜单 文件 - 另存为 对话框内编码选UTF-8
------解决方案--------------------
呵呵 是滴 txt它默认存储的是ANSI类型
------解决方案--------------------
你把你的那个txt文件改为jsp吧。然后在jsp中设置编码。