如果结果具有相似的文本,我需要打印一些文本,jquery中是否有like语句?类似于您在SQL中使用LIKE的方式?
if (r.events[i].room = 'craig')
$('#'+r.events[i].slot).append('<br />').append('craighouse');
没有LIKE
声明。但是,您可以使用来在另一个字符串中搜索一个字符串indexOf()
:
if (r.events[i].room.indexOf('craig') != -1) // -1 = not found
$('#'+r.events[i].slot).append('<br />').append('craighouse');
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句