Support Overview

Tutorials

Client API Usage Examples

Upgrade Information

FAQ

New Release History

You are here:   Visualware >   MyConnection Server >   Support >   Client API Usage Examples >   Passing results to a new tab and color coding

Passing results to a new tab and color coding

The example below passes the results of the test to a JavaScript method. This method analyzes the results, for color coding, and displays them in a table in a new tab on test completion.

Code Required

The code below just needs to be copied into a web page at the position the applet is to appear. The only change that will be needed is the codebase, highligted in red below. This should be changed to the address of your MyConnection Server installation.

The code in blue is the JavaScript call. The method name, passResults, is used to pass the results of the test to the JavaScript below.

The testspecid in green also needs to be changed. When a user creates a custom test a unique test id is assinged to it. As this example uses a VoIP and Speed test in the same applet it was necessary to create a custom test. The test ID in this test is unique to the Visualware MCS engine.

<applet mayscript name="mcs" code="myspeedserver/applet/myspeed.class"
archive="/myspeed/myspeed_s_8.jar,/myspeed/plugins_s_8.jar"
codebase="http://mcssjc.visualware.com/myspeed" width=600 height=400>
<param name="testspecid" value="517">
<param name="permissions" value="all-permissions">
<param name="js" value="passResults($SPEED.DSPEED$,$SPEED.USPEED$,$SPEED.QOS$,$SPEED.AVGRTT$,
$VOIP.JITTER$,$VOIP.DJITTER$,$VOIP.MOS$)">

</APPLET>

The code below is the JavaScript required to mimic this example. Paste this into the <head> </head> HTML tags.

<script type="text/javascript">

function passResults(dspeed,uspeed,qos,avgrtt,upjitter,downjitter,mos) {

var results_url = "results.html?"; //This is the location of the page that is to show the results
results_url += "dspeed="+dspeed;
results_url += "&uspeed="+uspeed;
results_url += "&qos="+qos;
results_url += "&avgrtt="+avgrtt;
results_url += "&ujit="+upjitter;
results_url += "&djit="+downjitter;
results_url += "&mos="+mos;

window.open(results_url,'_blank'); //Uses the results URL to open a new window
}



 

MyConnection Server

Home
Online Testing Portal
Download
Purchase
Resources
Support

Visualware Products

VisualRoute
eMailTrackerPro
Visual IP Trace

   

© Visualware Inc. 2017 - All Rights Reserved