Yes it's should be simple.Can anyone tell me why this won't right a string in the flippin body?
Thanks

<!-- 
    Document   : computer_object
    Created on : Feb 23, 2008, 11:47:50 PM
    Author     : James Howerton
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>computer_object</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <SCRIPT language="JavaScript">
            <!--
            //1.create object computer(speed,hdspaceand ram)properties
            function computer("speed","hdspace","ram"){
                this.speed=speed;
                this.hdspace=hdspace;
                this.ram=ram;
                this.price=get_price;
            }
            //3.  create instance of computer(work_computer,home_computer,laptop_computer)
            var work_computer=new computer("2GHz","80GB","1GB");
            var home_computer=new computer("1.5GHz","40GB","512MB");
            var laptop_computer=new computer("1GHz","20GB","256MB");
            
            //6.  creata get_price();the_price=1000
            //if speed=500MHz the_price+=200else the_price+=100
            //fihdspace=15GB,THE_PRICE+=50,ESLETHEPRICE+=25
            //IF ram=128MB,the_price+=150,else the_price+=75
            //return the_price
            function get_price(){
                if(this.speed="500GHz")
                    the_price+=200;
                else
                    the_price+=100;
                if(this.hdspace="15GB")
                    the_price+=50;
                else
                    the_price+=25;
                if(this.ram="128MB")
                    the_price+=150;
                else
                    the_price+=75;
            }
            var work_computer_price=work_computer.price();
            var home_computer_price=home_computer.price();
            var laptop_computer_price=laptop_computer.price();
            var computerData[]=new Array("work_computer","home_computer","laptop_computer");
            var count=0;
            function computerData(){
                document.write("<H2>The information on the computers you requested: </H2>");
                //for(count=0;count<computerData.length;count++){
                    //document.write("<B>computerData[count]+</br>";)
                    //for(var prop_name in computerData[count]{
                    //}
               // }
             
            }
            //-->
        </SCRIPT>
    </head>
    <body>
        <SCRIPT language="JavaScript">
            <!--
            computerData();
           
            //-->
        </SCRIPT>
    </body>
</html>

flippin

what does it mean ? document.write("<H2>The information on the computers you requested: </H2>"); use dom to add this in to document.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.