Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = function(){
- var appName = navigator.appName;
- var appVersion = navigator.appVersion;
- var msg = "Web Browser is " + appName + "\nWeb Browser Version is " + appVersion;
- alert(msg);
- };
- var itemTotal;
- var items = document.getElementsByTagName("input");
- document.getElementById("submit").addEventListener("click",calcTotal,false);
- function calcTotal() {
- var bullets = [];
- itemTotal = 0;
- for(var i=0;i<9;i++){
- if ( items[i].checked ) {
- itemTotal += (items[i].value * 1);
- bullets.push(items[i].name + " $" + items[i].value);
- }
- }
- totalCost = itemTotal.toFixed(2);
- foodWin = window.open("about:blank", "chinesefood", "width=320, height=240");
- foodWin.document.write("<h2>Your Chinese Food Order</h2>");
- foodWin.document.write("<ul>");
- for (var i = 0; i < bullets.length; i++){
- foodWin.document.write("<li>" + bullets[i] + "</li>");
- }
- foodWin.document.write("</ul>");
- foodWin.document.write("<br/>Total Order is $" + totalCost);
- setTimeout("foodWin.close()", 10000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement