I am taking a value from a java applet and storing it i na variable in JS. I then call an alert on this variable and the alert prints the correct value to screen but then when i call this variable again in the createApp function the variable prints as undefined and I have no idea why. any help would be apprieciated
JS code:
var app = {
notLoaded : true,
dataVar : "hello",
testApplet : function(){
while(app.notLoaded){
if(typeof myApplet.testString != 'undefined')
{
app.notLoaded = false;
this.dataVar = myApplet.testString;
alert(this.dataVar);
//window.open("menuPage.html");
app.createApp();
}
}
},
bluetoothPage : [ 0x10, [this.dataVar, "bluetoothMenu"],
0xA1, ["rpm2", "RPM2", "1500", "0", "3000"],
0xA1, ["rpm3", "RPM3", "1500", "0", "3000"],
0xD0],
createApp : function(){
//document.write(app.bluetoothPage);
app.createPage(menuPage);
app.createPage(app.bluetoothPage);
.........ect } closes object
all the other parts of the bluetoothPage work fine when the menu is written just the variable this.dataVar goes from being Hello World to undefined