No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
自動チャット招待のコードサンプル
このコードサンプルを使用して、Web サイトで自動チャット招待がどのように動作するかをテストおよびプレビューします。
カスタマイズされた招待を Web サイトに表示するために addButtonEventHandler() メソッドを使用する自動チャット招待のコードを次に示します。この招待では、適切なスキルを持つエージェントがチャットに対応できる場合に、顧客がエージェントとチャットを開始できます。
1swfobject.registerObject("clippy.codeblock-0", "9");<apex:page>
2<div id="liveagent_invite_button_573x0000000001O" style="display: none;
3 position: fixed; border: 2px solid darkblue; border-radius: 5px;
4 background-color: lightblue; height: 100px; width: 200px;">
5<div style="cursor: pointer; padding: 5px; right: 0px;
6 position: absolute; color: darkred; font-weight: bold;"
7 onclick="liveagent.rejectChat('573x0000000001O')">X</div>
8<div style="cursor: pointer; top: 42px; left: 65px; position: absolute;
9 font-weight: bold; font-size: 16px;"
10 onclick="liveagent.startChat('573x0000000001O')">Start Chat</div>
11</div>
12
13<script type='text/javascript'
14 src='https://c.la1s1.saleforceliveagent.com/content/g/deployment.js'>
15 </script>
16<script type='text/javascript'>
17function buttonCallback(e) {
18 if (e == liveagent.BUTTON_EVENT.BUTTON_AVAILABLE) {
19 document.getElementById('liveagent_invite_button_573x0000000001O').style.display
20 = '';
21 document.getElementById('liveagent_invite_button_573x0000000001O').style.left =
22 '300px';
23 document.getElementById('liveagent_invite_button_573x0000000001O').style.top =
24 '200px';
25 }
26 if (e == liveagent.BUTTON_EVENT.BUTTON_UNAVAILABLE) {
27 document.getElementById('liveagent_invite_button_573x0000000001O').style.display =
28 'none';
29 }
30 if (e == liveagent.BUTTON_EVENT.BUTTON_ACCEPTED) {
31 document.getElementById('liveagent_invite_button_573x0000000001O').style.display =
32 'none';
33 }
34 if (e == liveagent.BUTTON_EVENT.BUTTON_REJECTED) {
35 document.getElementById('liveagent_invite_button_573x0000000001O').style.display =
36 'none';
37 }
38}
39liveagent.addButtonEventHandler('573x0000000001O', buttonCallback);
40liveagent.init('https://d.la1s1.salesforceliveagent.com/chat', '572x00000000001',
41 '00Dx00000001gEH');
42</script>
43</apex:page>上記のコードの結果は、次のような招待になります。
