我有我的网站实时聊天开放时间,每个人都有自己的ID(数据聊天类别)。有一个类别ID我想要针对不同的开放时间。我努力编写一个IF语句来定位这个ID。我已经提取出需要编辑的JS。JS IF声明编号
这里是ID为的HTML:
<div class="live_chat" data-chat-interface="toms" data-chat-category="407" data-chat-product="370"></div>
下面是参数:
var iChatCategory = $(this).attr('data-chat-category');
,这是位我不能得到正确的或需要添加IF statetment太:
// Show correct opening times for all iChatCategorys except 407
var sOpeningTimes = (sChatInterface.indexOf("toms") >= 0) ? 'Live chat is open Monday to Thursday from 8:30am to 5:30pm, Friday 8:30am to 5pm.' : 'Live chat is open Monday to Friday from 8am to 8pm, Saturday 8am to 6pm.';
// Show correct opening times for iChatCategorys 407 only goes under here?
'如果(ichatcategory == 407){设定特殊小时}其他{设定标准工时}'? –
究竟是什么问题?你有错误吗? – Pointy