Next, we illustrate how easily we can grab values from the applet using getValue. Why not take advantage of that excellent CAS engine using evalCommandCAS? ( NOTE: You may need to press the button a time or two on first use to give the CAS engine time to come on board!) To act upon or read values from a GeoGebra object, you will need to create that object first, either in your source document, or right there in youe web page as needed (although those you create on the fly will not be there once the page is refreshed, whereas variables created in the source document, of course, will always be available. Other useful commands include setValue and getValue and many others that you will find in that long API reference page! This function makes use of the powerful evalCommand GeoGebra function. Try typing a command, like "frequency = 110" and press the Input button and you will see what I mean. So having a nice easily accessible input bar at my disposal on my web page is a great thing! I find writing to that Input bar a little problematic at times - sometimes it gets hidden, and typing to it can be a little tricky. SetFunction() uses the input button and the textArea (called "textBox") and simulates the actual GeoGebra Input Bar which appears and disappears at the bottom of the applet window. We add some functions which illustrate just some of the power we now have at our fingertips. If you have any questions or would like to share your experience with this utility, please drop me an email! This is where you will paste the code that you got for your online document! Just for interest, try copying and pasting "dwxd6tcv" in place of the materials ID given and check out another GeoGebra document that I prepared earlier.ĪddEventListener literally injects the defined app into the div statement ( "ggb-element") created in the BODY below.įinally, the DIV line in the BODY which actually contains what will be our applet ( div id="ggb-element") - this is where the applet will appear on our web page!. Try changing each of these and see the result! Take particular note of the "material_id" ("matID"). The next section looks complicated, but is simply the list of properties that we want our applet to possess. Instead, again, we might be better served beginning with the last of the links above and follow the steps given in the Quick Start for embedding GeoGebra apps within a web page - and you will recognise these as they occur in our example code which follows.įirst, you will observe a link within the HEAD of the script to the online instruction set ( "") which interprets the various embedding commands. If, initially, this page makes little sense to you, don’t worry - I felt the same way (and still do with regard to much of it!). Refer to the link above to the GeoGebra Apps API, which details the many ways in which GeoGebra supports interaction between its applet and the web page hosting it. The GeoGebra document that you wish to use with your web page will have an ID code - just look for share in the menu and copy the code produced. YOU will need to use one of these or to create your own and then save it to this repository using any version of GeoGebra - although I confess I much prefer GeoGebra Classic with the full array of functionality over the more limited Graphing and Geometry apps now available. This gives you access to their online repository of created documents. We begin our tutorial, once again, with the simplest of exemplars - no bells and whistles: the easiest way to embed a GeoGebra applet within a web page.īefore you can embed a GeoGebra applet within your web page, you first need to create a free GeoGebra account at. New to GeoGebra? Perhaps you should take a few minutes to have a look through their Getting Started page? Or just Google "Getting Started with GeoGebra" - there are many great YouTube videos out there! Lesson 12: Introduction to HTML Graphics: Canvas.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |