我有我的網站實時聊天開放時間,每個人都有自己的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