两个字符串完全一样,判断却不相等
console.log("==========================onShow()");
var sectionText = that.data.sectionText;
var sectionText2 = that.data.sectionText2;
console.log(sectionText.constructor); console.log(sectionText2.constructor);
console.log("that.data.sectionText=" + that.data.sectionText);
console.log("that.data.sectionText2=" + that.data.sectionText2);
console.log("that.data.sectionText.length=" + that.data.sectionText.length);
console.log("that.data.sectionText2.length=" + that.data.sectionText2.length);
console.log("that.data.sectionText != that.data.sectionText2=" + that.data.sectionText.trim() != that.data.sectionText2.trim());
console.log("that.data.sectionText == that.data.sectionText2=" + that.data.sectionText == that.data.sectionText2);
console.log("sectionText != sectionText2=" + sectionText != sectionText2);
console.log("encodeURIComponent(sectionText)=" + encodeURIComponent(sectionText));
console.log("encodeURIComponent(sectionText2)=" + encodeURIComponent(sectionText2));
console.log("encodeURIComponent(sectionText) == encodeURIComponent(sectionText2)=" + encodeURIComponent(sectionText) == encodeURIComponent(sectionText2));
house.js? [sm]:113 ==========================onShow()
house.js? [sm]:116 ƒ String() { [native code] }
house.js? [sm]:116 ƒ String() { [native code] }
house.js? [sm]:117 that.data.sectionText=碧桂园
house.js? [sm]:118 that.data.sectionText2=碧桂园
house.js? [sm]:119 that.data.sectionText.length=3
house.js? [sm]:120 that.data.sectionText2.length=3
house.js? [sm]:121 true
house.js? [sm]:122 false
house.js? [sm]:123 true
house.js? [sm]:124 encodeURIComponent(sectionText)=%E7%A2%A7%E6%A1%82%E5%9B%AD
house.js? [sm]:125 encodeURIComponent(sectionText2)=%E7%A2%A7%E6%A1%82%E5%9B%AD
house.js? [sm]:126 false
house.js? [sm]:130 true
换成逗号怎么连接呢
逗号链接啊console.log('名字',name) 这样
还是不相等
},onShow:function(){
console.log("==========================onShow()");
var sectionText = new String(that.data.sectionText);
var sectionText2 = new String(that.data.sectionText2);
console.log(sectionText.constructor); console.log(sectionText2.constructor);
console.log("that.data.sectionText=",that.data.sectionText);
console.log('that.data.sectionText2', that.data.sectionText2)
console.log("that.data.sectionText.length=================",that.data.sectionText.length);
console.log("that.data.sectionText2.length==================",that.data.sectionText2.length);
console.log("sectionText 不等于 sectionText2=",sectionText != sectionText2);
==========================onShow()
house.js? [sm]:116 ƒ String() { [native code] }
house.js? [sm]:116 ƒ String() { [native code] }
house.js? [sm]:117 that.data.sectionText= 碧桂园
house.js? [sm]:118 that.data.sectionText2 碧桂园
house.js? [sm]:119 that.data.sectionText.length================= 3
house.js? [sm]:120 that.data.sectionText2.length================== 3
house.js? [sm]:121 sectionText 不等于 sectionText2= true
不应该啊.....
你把中间的加号换成逗号试试
你用equals试一下,许愿启明星的指引
js没有equals方法
那个不能evl
感谢,兄弟,可以了,估计用加号成为连接符了