beautypg.com

Section 3. events – MagTek BLUETOOTH SWIPE READER User Manual

Page 25

background image

19

SECTION 3. EVENTS

1) On a card data change event:

In the event of card data change, the applet will return the card-swipe data by calling the Java script provided in
the para name of RunJSOnCardDataChange. The Java script to be called must have one parameter to receive
the card-swipe data. For example, the applet will return the card-swipe data by calling the “SetCardData” Java
script in the following example. The “SetCardData” function prototype is as follows:

function SetCardData(cardSwipedData)
{ //Do something on a card data change event. }

<

script

language

="JavaScript">

if

(window.navigator.appName.toLowerCase().indexOf(

"netscape"

)!=-1)

{

// set object for Netscape:

document.getElementById(

'dvObjectHolder'

).innerHTML =

"

type=\"application/x-java-applet;version=1.5\""

+

"codebase =\".\""

+

"archive = \"JMTBluetoothReader.jar\""

+

"code=\"JMTBTCardReader.class\""

+

"name=\"MTRS232MSR\""

+

"scriptable=\"true\""

+

"style=\"visibility:hidden;\""

+

"mayscript=\"mayscript\""

+

"pluginspage=\"http://java.com/en/download/index.jsp\""

+

">"

+

""

+

""

+

""

+

""

+

"

"

;

}

else

if

(window.navigator.appName.toLowerCase().indexOf(

'internet

Explorer'

)!=-1){

//set object for IE

document.getElementById(

'dvObjectHolder'

).innerHTML =

"

type=\"application/x-java-applet;version=1.5\""

+

"codebase =\".\""

+

"archive = \"JMTBluetoothReader.jar\""

+

"code=\"JMTBTCardReader.class\""

+

"name=\"MTRS232MSR\""

+

"height=\"0\" width=\"0\" >"

+

""

+

""

+

""

+

""

+

""

+

"

"

}

script

>


2)

If the param name “

ReportJavaPluginVersion” is set to “yes”, the Java script

ReportJavaPluginVersion

” should be available to be called and will have

the following function prototype:

function

ReportJavaPluginVersion(ver) {//Do something }