Activity Stream
48,167 MEMBERS
62208 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1.     
    #1
    Member
    Website's:
    eih.bz pornDDL.me sexytattoochicks.tumblr.com

    Default JavaScript easy help needed

    Hey guys,

    I need some JS help, I dunno why it doesn't work tbh :/
    It's something simple..

    Here is the code
    PHP Code: 
    <script language="javascript" type="text/javascript" >     
    <!-- 
        function 
    optellen(a,b
        {
                var 
    res parseInt(a) + parseInt(b);
                return 
    res;
        }
        var 
    getal1 prompt("Type eerste getal in");
        var 
    getal2 prompt("Type tweede getal in");
        var 
    uitkomst optellen(getal1getal2);
        
    document.write(getal1 " plus " getal2 " = " uitkomst);
    -->
    </script> 
    And the full header:
    PHP Code: 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <
    html>
    <
    head>
    <
    link rel="SHORTCUT ICON" href="sun.png" type="image/x-icon" />
        <
    titleTROLOLOLOLO </title>
    <
    link href="style.css" rel="stylesheet" type="text/css" /> 

    <!-- 
    JAVASCRIPT hoofdstuk 4--> 
    <
    script language="javascript" type="text/javascript" src="code.js"></script>
    <script language="javascript" type="text/javascript" >     
    <!-- 
        function optellen(a,b) 
        {
                var res = parseInt(a) + parseInt(b);
                return res;
        }
        var getal1 = prompt("Type eerste getal in");
        var getal2 = prompt("Type tweede getal in");
        var uitkomst = optellen(getal1, getal2);
        document.write(getal1 + " plus " + getal2 " = " + uitkomst);
    -->
    </script>
    <!-- JAVASCRIPT --> 
    </head> 
    I dunno where it went wrong

    Any help appreciated

    Cheers
    pi0tr3k Reviewed by pi0tr3k on . JavaScript easy help needed Hey guys, I need some JS help, I dunno why it doesn't work tbh :/ It's something simple.. Here is the code <script language="javascript" type="text/javascript" > <!-- function optellen(a,b) { Rating: 5

  2.   Sponsored Links

  3.     
    #2
    I r Super Cop
    forgot to close the html tag?
    Follow besthostingforums on FB

    Looking for an Article Writer? Check out my services here.

  4.     
    #3
    Member
    Website's:
    eih.bz pornDDL.me sexytattoochicks.tumblr.com
    No no mate, it's all OK I only posted the <head> section here

    Anyways, here is the whole page:
    PHP Code: 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <
    html>
    <
    head>
    <
    link rel="SHORTCUT ICON" href="sun.png" type="image/x-icon" />
        <
    titleTROLOLOLOLO </title>
    <
    link href="style.css" rel="stylesheet" type="text/css" /> 

    <!-- 
    JAVASCRIPT hoofdstuk 4--> 
    <
    script language="javascript" type="text/javascript" src="code.js"></script>
    <script language="javascript" type="text/javascript" >     
    <!-- 
        function optellen(a,b) 
        {
                var res = parseInt(a) + parseInt(b);
                return res;
        }
        var getal1 = prompt("Type eerste getal in");
        var getal2 = prompt("Type tweede getal in");
        var uitkomst = optellen(getal1, getal2);
        document.write(getal1 + " plus " + getal2 " = " + uitkomst);
    -->
    </script>
    <!-- JAVASCRIPT --> 
    </head>
        
    <body>

    <center>
    <a href="#down"><img src="down.png" /></a>
    <a id="top"></a>
        <h1> MINGA </h1> 
            <img src="http://s1.eih.bz/images/photo1.gif" height="250px" width="250px" />
                <h2> Kleinere minga </h2>
                <h3> Blah </h3>
            <p><span>

            <font color="#FF0000"> ben ik rood? ow yeah</font>
    <br>
            sdf:gnsdfklgnsdfgn lkdfsgl dsfngkl jdfnbknxcklvn wxcbknv ssdf:gnsdfklgnsdfgn lkdfsgl dsfngkl jdfnbknxcklvn wxcbknv s<br />
            sdf:gnsdfklgnsdfgn lkdfsgl dsfngkl jdfnbknxcklvn wxcbknv ssdf:gnsdfklgnsdfgn lkdfsgl dsfngkl jdfnbknxcklvn wxcbknv s<br /></span></p>
                <em>helllo em tag </em> 

    mother of God<br />
    <h1> <a href="lists.html" >Lists</a> </h1></br>
    <h1> <a href="images.html" >Images</a> </h1></br>
    <h1> <a href="tables.html" >Tables</a> </h1></br>
    <a href="javascript:popup();">Alert popup JavaScript<a> <br /> 
    <a href="javascript:pr0mpt();">Prompt popup JavaScript<a> <br /> 
    <a href="javascript:pr0mpt2();">Prompt 2 popup JavaScript<a> <br /> 
    <a href="javascript:optellen();">Prompt 2 getallen optellen<a> <br /> 
    <a href="koppeling.html" > Ga terug zeimer </a><br />
    <a href="koppeling.html" > Ga terug zeimer </a><br />
    <a href="koppeling.html" > Ga terug zeimer </a><br />
    <a href="koppeling.html" > Ga terug zeimer </a><br />
    <a href="koppeling.html" > Ga terug zeimer </a><br />
    <a href="koppeling.html" > Ga terug zeimer </a><br />
    <a href="#top"><img src="up.png" /></a><br />
    <a href="koppeling.html#down">Down</a>
    <a id="down"></a>
    </center>
    </body>
    </html> 

  5.     
    #4
    Member
    Website's:
    sborg.us
    You missed a plus sign before " = " in document.write

    V3g3ta | Halcyon | Abhi

  6.     
    #5
    Member
    Website's:
    eih.bz pornDDL.me sexytattoochicks.tumblr.com
    OMG

    Thanks a lot

    ---------- Post added at 12:09 PM ---------- Previous post was at 12:02 PM ----------

    One more little question, the script starts everytime I refresh the page.
    I've also added a link to make it work, but it returns "NaN" when I click it:
    <a href="javascript:optellen();">Prompt 2 getallen optellen</a> <br />
    Ideas?

  7.     
    #6
    Member
    Website's:
    sborg.us
    Lol, it says "null plus null = NaN" on top if I simply press OK

    Do a proper checking of what input the user provides.

    V3g3ta | Halcyon | Abhi

  8.     
    #7
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    you must make a new function
    Code: 
    function optellen(a,b) 
        {
                var res = parseInt(a) + parseInt(b);
                return res;
        }
    function getoptellen() {
        var getal1 = prompt("Type eerste getal in");
        var getal2 = prompt("Type tweede getal in");
        var uitkomst = optellen(getal1, getal2);
        document.write(getal1 + " plus " + getal2 + " = " + uitkomst);
    }
    


    and call it
    Code: 
    <a href="javascript:getoptellen();">Prompt 2 getallen optellen</a> <br />

  9.     
    #8
    Member
    Website's:
    eih.bz pornDDL.me sexytattoochicks.tumblr.com
    Doesn't work t3o

  10.     
    #9
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    i typed the function name wrong, check now

  11.     
    #10
    Member
    Website's:
    forumhookers.com
    Whether you need help in this?

    Or it is fixed? Let me know through pm!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Hiring] jquery javascript popup needed
    By tractor3231 in forum Completed Transactions
    Replies: 0
    Last Post: 8th Aug 2011, 03:51 PM
  2. Easy-Share Preimum Needed
    By BeboHeart in forum General Discussion
    Replies: 7
    Last Post: 30th Jun 2011, 03:07 PM
  3. [Hiring] GFX Needed ( Small Easy Job )
    By Crossy in forum Completed Transactions
    Replies: 3
    Last Post: 18th Mar 2011, 07:55 PM
  4. Javascript help needed
    By Storm in forum Technical Help Desk Support
    Replies: 1
    Last Post: 6th Jan 2010, 10:45 PM
  5. Replies: 12
    Last Post: 19th Jul 2009, 08:06 AM

Tags for this Thread

BE SOCIAL