ggb-applet or quicktime-movie?

nobsy shared this question 9 years ago
Answered

I'm writing HTML-pages with mathematical content and I embed geogebra applets. Unfortunately the iPhone does not support Java, so the applets do not start.

Is it possible to write the code for the page in that way, that on Java-enabled machines the applet starts and on the iPhone a corresponding quicktime movie starts. JavaScript like this:

if (navigator.javaEnabled()==true) { //display applet} else { //display quicktime-movie}


Thanks for your help.

Norbert

Comments (2)

photo
1

Yes, that should be possible e.g. by changing the content of a container if Java is not enabled. There are several ways how to achieve this, I have appended untested code to give you an idea of one possible way. :)


HTML:

    <div id="applet-container">APPLET HTML CODE</div>


JavaScript:

    if (!navigator.javaEnabled()) {

    document.getElementById("applet-container").innerHTML = "MOVIE HTML CODE";

    }


Florian

photo
1

In the meanwhile I found a way to do it:


In the HTML-file you call a JavaScript-file like this:

<script src="scripte/appletOrMovie.js" type="text/javascript"></script>


In the JavaScript-file you write:

<!--

// Dynamic HTML as Javascript


switch=true;


function aom() {

switch=(navigator.javaEnabled()==true);


if (switchr==true) {

document.writeln("<applet name=\"ggbApplet\" code=\"geogebra.GeoGebraApplet\" codebase=\"./\" archive=\"ggb/geogebra.jar\" width=\"260\" height=\"320\">");

document.writeln("<param name=\"filename\" value=\"nameOfApplet.ggb\">");

document.writeln("<param name=\"framePossible\" value=\"false\">");

document.writeln("<param name=\"showResetIcon\" value=\"false\">");

document.writeln("<param name=\"enableRightClick\" value=\"false\">");

document.writeln("<param name=\"showMenuBar\" value=\"false\">");

document.writeln("<param name=\"showToolBar\" value=\"false\">");

document.writeln("<param name=\"showToolBarHelp\" value=\"false\">");

document.writeln("<param name=\"showAlgebraInput\" value=\"false\">");

document.writeln("</applet>");

}

else {

document.writeln("<embed src=\"nameOfQTMovie.mov\" width=\"260\" height=\"360\" loop=\"false\" controller=\"true\" pluginspage=\"http://quicktime.apple.com\"; autoplay=\"false\" enablejavascript=\"true\"> ");

}//Ende if else


}//End Function


aom(); //call function to display applet or movie


// -->

© 2019 International GeoGebra Institute