通过jquery获取下拉列表选中的值,其中courseTypeValue 获取的值alert显示确实是“课程设计”,但是不知为什么判断就是不相等,当要是获取的值不是中文的情况下,判断就是相等的,难道是因为中文编码的原因么?
var courseTypeValue = $(this).val();
alert(courseTypeValue);
alert(courseTypeValue=='课程设计');
求大神解答! 谢谢
var courseTypeValue = $(this).val();
alert(courseTypeValue);
alert(courseTypeValue=='课程设计');
求大神解答! 谢谢
你alert(courseTypeValue.length)和alert("课程设计".length)是一样的吗
页面文件另存为utf-8
最简单的方法,记事本打开,另存为UTF-8。