#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    3
    Rep Power
    0

    Post Easy task who has some time with JS


    Hi guys. Maybe somebody would be interested in some $ for very simple javascript task. Here is what i need:

    Task 1:
    Kg and Mg converter to g.

    Req:

    Use at least one function
    Use object.
    Object has to have at least one attribute and method.
    Object has to have function constructor.
    Use anonymous function.


    Tasks 2. Tasks 1 but with interface:

    Use method addEventListener at least 3 times.
    Use DOM
    Result output in div tags.
    Button uses div tags
    Use move method at least for one element.
    Use frames, colors.


    reward 10-15$ paypal. everything done in html doc with javascript thanks.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    People here will help you do your homework, but they're not going to do it for you.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    3
    Rep Power
    0
    ok. i have this code..but i cant make it work..


    Code:
    <script language="JavaScript">
    function kgskaiciavimas(){
    document.skaiciavimas.mg.value = document.skaiciavimas.kg.value * 1000000
    document.skaiciavimas.g.value = document.skaiciavimas.kg.value * 1000
    }
    function mgskaiciavimas(){
    document.skaiciavimas.kg.value = document.skaiciavimas.mg.value / 1000000
    document.skaiciavimas.g.value = document.skaiciavimas.mg.value / 1000
    }
    function gskaiciavimas(){
    document.skaiciavimas.kg.value = document.skaiciavimas.g.value / 1000
    document.skaiciavimas.mg.value = document.skaiciavimas.g.value / 1000
    }
    </script>
    
    <form name="skaiciavimas">
    Kilogramai: <input type="number" name="kg" onChange="kgskaiciavimas()"><br />
    Miligramai: <input type="number" name="mg" onChange="mgskaiciavimas()"><br />
    Gramai: <input type="number" name="g" onChange="gskaiciavimas()"><br />
    <input type="button" value="Skaiciuoti!" />
    </form>
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    What part of it isn't working? I see a basic arithmetic error in the gskaiciavimas function, but the code functions for me.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo