Presentation is loading. Please wait.

Presentation is loading. Please wait.

pop_up_windows // ALL STATEMENTS AFTER THE // ARE COMMENTS AND CAN BE REMOVED <!--Begin function popupPage(page) { //page is a varibale the value is input.

Similar presentations


Presentation on theme: "pop_up_windows // ALL STATEMENTS AFTER THE // ARE COMMENTS AND CAN BE REMOVED <!--Begin function popupPage(page) { //page is a varibale the value is input."— Presentation transcript:

1

2 pop_up_windows // ALL STATEMENTS AFTER THE // ARE COMMENTS AND CAN BE REMOVED <!--Begin function popupPage(page) { //page is a varibale the value is input in the HTML code windowprops = "height=300,width=600,left=100,top=200," + "scrollbars=yes,menubars=no,toolbars=no,resizable=no"; // windowprops is a user named string. Its use is for // the convenience of a long argument component window.open(page, "Popup", windowprops); // window.open is a java scipt function // with three arguments // -- name of page to be opened in the window // -- the name of the window // -- the properties of window // -- for more infor go to // -- http://hotwired.lycos.com/webmonkey/98/03/ // index3a_page3.html?tw=programming } // End--> Popup window 1/2

3 Some Examples of running a JavaScript Pop up Window Hit This Button to open a blank page Mouse Over this button to open a blank page Click the FORM button to open a blank page Click to go web monkey tutorial on pop ups. Popup window 2/2

4 Two Point Gauss //Function for Gauss Two Point Eval. of Exp(x) //between start and stop function gauss(form){ //Gauss Points var g = Array(2); // set up a 1-D array with two storage loactions // first location is indexed 1 the second is indexed 2 // a 2-D array would be declared as Array(3,3) g[1]=-1.0/(Math.sqrt(3)); g[2]= 1.0/(Math.sqrt(3)); //MATH functions must have uppercase M in word Math var w = Array(2); w[1]=1.0; w[2]=1.0; var Start = eval(form.Start.value); var Stopz = eval(form.Stopz.value); var integral = 0.0; for(i=1; i<=2; i++){ g[i] = (Stopz-Start)*g[i]/2.0+(Stopz+Start)/2.0; w[i] = ((Stopz-Start)*w[i]/2.0); integral = integral + w[i]*Math.exp(g[i]); //round answer to 4 places integral=10000*integral; integral=Math.round(integral)/10000; } form.answer.value = integral; } Gauss page1

5 Gauss page2 Two Point Gauss Integrator (may not be accurate) Enter Start: Enter Stop: Page Prepared by V.R. Voller, University of Minnesota, volle001@tc.umn.edu

6 dowhile //demonstration of do while var gap=100; do { gap=gap/2; } while (gap>=5); document.write(gap); document.write(" "); gap=100; while (gap>=15) { gap=gap/2; } document.write(gap); Click the viewsource to see the code Do while Loops


Download ppt "pop_up_windows // ALL STATEMENTS AFTER THE // ARE COMMENTS AND CAN BE REMOVED <!--Begin function popupPage(page) { //page is a varibale the value is input."

Similar presentations


Ads by Google