Change background image
  1. What's up? I see you're viewing as a Guest. How about registering, it only takes like 2 minutes. This will enable you to do more on our forum and stay updated.

Calculator made with javascript

Discussion in 'PC General' started by iiPwner, Jul 11, 2011.

Thread Status:
This thread is more than 180 days old.
  1. iiPwner

    iiPwner Junior Member Member

    here is a calculator i made using javascript
    Code:
    <style type="text/css">
    table.calc {
         border: 2px solid #0034D1;
         background-color: #809FFF;
    }
    input.calc {
         width: 100%;
         margin: 5px;
    }
    </style>
    <fieldset>
    <legend>Demo</legend>
    <table class="calc" cellpadding=4>
    <tr><td colspan=3><input class="calc" id="screen" type="text"></td></tr>
    <tr>
    <td><input class="calc" type="button" value=1 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value=2 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value=3 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value='/' onclick="pushButton(this.value);"></td>
    </tr>
    <tr>
    <td><input class="calc" type="button" value=4 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value=5 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value=6 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value='*' onclick="pushButton(this.value);"></td>
    </tr>
    <tr>
    <td><input class="calc" type="button" value=7 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value=8 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value=9 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value='-' onclick="pushButton(this.value);"></td>
    </tr>
    <tr>
    <td><input class="calc" type="button" value=0 onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value='.' onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value='C' onclick="pushButton(this.value);"></td>
    <td><input class="calc" type="button" value='+' onclick="pushButton(this.value);"></td>
    </tr>
    <tr><td colspan=3><input class="calc" type="button" value='=' onclick="calculate(document.getElementById('screen').value);"></td></tr>
    </table>
  2. 3nvisi0n

    3nvisi0n The R3v0lu710n Super-Mod

    Okay, Problems
    One: you did not make this.
    Two: you didn't test it(it doesn't work)
    Three: There is no valid javascript in this.
    Four: You copied and pasted this wrong.(Forgot all the Javascript)

    Please cite your sources and don't act like you did everything...I look into it all the time.

    Original Source: http://www.randomsnippets.com/2008/...our-own-customized-calculator-via-javascript/
    I won't change it to make a normal copied tutorial because this example doesn't work :\

    Original: http://www.randomsnippets.com/2008/...our-own-customized-calculator-via-javascript/
  3. iiPwner

    iiPwner Junior Member Member

    envy thats were your wrong i forgot to say it was a demo i took all the main functions out so you can add your own
  4. 3nvisi0n

    3nvisi0n The R3v0lu710n Super-Mod

    Nice try Pwner, all you have in this is some HTML and CSS there is no valid javascript.It is not something to even build off from, and considering its a Calculator there is not a whole lot of room to build from what 'you' included. You didn't remove the main functions you didn't include any at all(nothing to demo)l. Besides that you did not make it to begin with http://www.randomsnippets.com/2008/04/26/how-to-create-your-own-customized-calculator-via-javascript/ has all of 'your' HTML.

    I do not take copying tutorials lightly, give credit where its due. I do check nearly every tutorial I see.
  5. Jok3r

    Jok3r MC-Admin/Summoner Member

    Thats why i write my tutorials in my iPod while im in the library just walking around.
    Library puts my mind at ease...
  6. dns

    dns Active Member Admin

    iiPwner, I completely agree with envy on this. We aren't trying to be dicks we are only ensuring that people cite original source and ensure their post quality. We don't want people coming here and getting confused trying to use busted tutorials or scripts. People need to have things to use and learn from so let's give it to them k.
Thread Status:
This thread is more than 180 days old.

Share This Page