Support Overview

Tutorials

Usage Examples

Upgrade Information

FAQ

New Release History

You are here:   Visualware >   MyConnection Server >   Support >   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.

<script>

// 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;

}
</script>

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="mcsord.visualware.com">Chicago, IL</option>
<option value="mcsiad.visualware.com">Dulles, VA</option>
<option value="mcslhr.visualware.com">London, England</option>
<option value="mcssjc.visualware.com">San Jose, CA</option>
</select>
<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>
</select>

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

<!-- 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

Home
Online Testing Portal
Download
Purchase
Resources
Support

Visualware Products

VisualRoute
eMailTrackerPro
Visual IP Trace

   

© Visualware Inc. 2014 - All Rights Reserved