Jhiciano
Contributor
Contributor

VMware HTML Console SDK - Blank Page

I am testing getting this working

the code I use is below, I get the ticket by calling  acquireMksTicket method.  I put the ticket at the end of the wmks.connect url and do put in our actual host.

I get a browser page to open but its blank with no errors.

Get ticket = https://VCENTERIP/mob/?moid=vm-379282&method=acquireMksTicket

html code

<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Console</title>

</head>

<body>               

  <link rel="stylesheet" type="text/css" href="https://communities.vmware.com/static/css/wmks-all.css" />

                <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>

                <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/jquery-ui.min.js"></script>

                <script type="text/javascript" src="/static/js/wmks.js" type="text/javascript"></script>

                <a href="javascript:void(wmks.sendKeyCodes([17,18,46]))">send Ctrl+Alt+Del</a>

                <a onClick="goFullScreen()" href="#">go full screen</a>

                <a href="javascript:void(disconnect())">disconnect</a>

  <a href="javascript:void(wkms.showKeyboard())">show keyboard</a>

                <a href="javascript:void(wkms.hideKeyboard())">hide keyboard</a>

                <div id="wmksContainer" style="position:absolute; width:800px; height:600px;"/>

                <script>

                    function goFullScreen() {

                        wmks.enterFullScreen();

                        wmks.setRemoteScreenSize(screen.height, screen.height);

                        wmks.updateScreen();

                    }

                    function disconnect() {

                        wmks.disconnect();

                        wmks.destroy();

                    }

                </script>

                <script>

                    var wmks = WMKS.createWMKS("wmksContainer",

                            {

                                enableUint8Utf8: true,

                                {#                                changeResolution: false,#}

                                {#                                enableVVC: false,#}

                                VCDProxyHandshakeVmxPath: "{{ vmx }}",

                            });

                    console.log(wmks.getConnectionState());

                    wmks.register(WMKS.CONST.Events.CONNECTION_STATE_CHANGE,

                            function(event,data){

                                if(data.state == WMKS.CONST.ConnectionState.CONNECTED){

                                    console.log("connection state change : connected");

                                }

                            }

                    );

                    wmks.register(WMKS.CONST.Events.ERROR,

                            function(event,data){

                                console.log("PLAF");

                            }

                    );

                    wmks.connect("wss://"Host":902/ticket/"Ticket"");

                    console.log(wmks.getConnectionState());

                    window.onbeforeunload = function(){

                        wmks.disconnect();

                    };

</script >

</body>

</html>

0 Kudos
0 Replies