Polycom, Inc. 90
This section provides JavaScript examples that work in conjunction with the browser on Polycom
500 and 1500 phones.
The lines of code shown below may have wrapped. If you cut and paste these lines, they can
inadvertently contain line breaks. Check for valid code before executing.
The following example shows how to control soft keys.
html>
<head>
<Title>Softkey JavaScript Test</Title>
<script type="text/javascript">
// PolySoftKey is the exported DOM object
// Registers a JavaScript function to be executed when a custom softkey
event occurs
PolySoftKey.customSoftkeyEvent.connect(skCallBack);
PolySoftKey.setSoftkeyLabel(0, "one");
PolySoftKey.setSoftkeyLabel(1, "Two");
PolySoftKey.setSoftkeyLabel(2, "Three");
PolySoftKey.setSoftkeyLabel(3, "Four");
function skCallBack(key, skEvent){
switch(key){
case 0:
document.getElementById("eventStuff").innerHTML = "SK 1 was pressed";
break;
case 1:
document.getElementById("eventStuff").innerHTML = "SK 2 was pressed";
break;
case 2:
document.getElementById("eventStuff").innerHTML = "SK 3 was pressed";