Support Overview


Client API Usage Examples

Upgrade Information


New Release History

You are here:   Visualware >   MyConnection Server >   Support >   Client API Usage Examples >   User Defined Test Location

User defined Test Location and Test Type

Choose Location:

Choose Test Type:

Code Required

This example is designed for users that wish to use MyConnection Server as the test engine. For users that wish to use their Access Cloud Servers click here.

Copy and paste the code below into the <head></head> section of the web page.


// Used to grab parameters from the URL address
function gup( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null ) return "";
else return results[1];}

// Assigns variable values based on URL values set
// when submitting the form

var loc = gup( 'chooseLocation' );
var showtest = gup( 'showApp' );
var testtype = gup( 'chooseTest' );

//Assigns blank values when page first loads
//These can be changed to show a default test type upon loading
if (showtest == "") { showtest = ""; }
if (loc == "") { loc = ""; }
if (testtype == "") { testtype = ""; }

// Called when the form is submitted
function loadApplet() {

var code = '<applet mayscript name="mcs" code="myspeedserver/applet/myspeed.class" archive="/myspeed/myspeed_s_8.jar,/myspeed/plugins_s_8.jar" codebase="http://'+ loc +'" width=600 height=400>';
code += '<param name="testspecid" value="'+ testtype +'">';
code += '<param name="permissions" value="all-permissions">'
code += '</APPLET>';

document.getElementById('testApplet').innerHTML = code;


Copy and paste the code below where the form and applet should appear.

Code comments shown in blue.

NOTE: The "value" parameter when chossing a test location needs to be updated to show the users MCS IP/URL, without the HTTP:// prefix. The locations shown in the example are Visualware locations and will not work on another web site.

<!-- Form for choosing test location and test type -->
<form action="index.html" method="get">
Choose Location:
<select id="chooseLocation" name="chooseLocation">
<option value="">Chicago, IL</option>
<option value="">Dulles, VA</option>
<option value="">London, England</option>
<option value="">San Jose, CA</option>
<br> <br>

<!-- choosing test type -->
Choose Test Type:
<select id="chooseTest" name="chooseTest">
<option value="-1">VoIP</option>
<option value="-2">Speed</option>
<option value="-5">IPTV</option>

<input type="text" id="showApp" name="showApp" value="yes" style="display:none;">
<input type="submit" value="Set Parameters" >

<!-- This defines the location of the applet when the form has
been submitted. Place in your page accordingly -->

<div id="testApplet"></div>

<script>if (showtest == "yes") { loadApplet(); }</script>


MyConnection Server

Online Testing Portal

Visualware Products

Visual IP Trace


© Visualware Inc. 2017 - All Rights Reserved