Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (2)

Powered by Vanilla. Made with Bootstrap.
JS Challenge 4
  • x3n0n
    Posts: 110
    Here is number 4 of my javascript challenges
    I hope you like it (and I hope it is difficult enough) :p

    //Challenge four
    function display_error(pi,one,two)
    {
    try
    {
    if (pi==\"31415\")
    throw \"line1\";
    else
    throw \"line2\";
    }
    catch(co)
    {
    if(co==\"line1\")
    {
    var x=prompt(two,\"\");
    return x;
    }
    if(co==\"line2\")
    {
    alert(one);
    return \"\";
    }
    }
    }

    var lol=\"test123\";

    function get_user()
    {
    var name=prompt(\"Username:\",\"\");
    var error=\"Sorry, wrong username\";
    var password=\"Password:\";
    if(display_error(name,error,password)==lol)
    {
    alert(\"Welcome, \" + name);
    //add points for completing challenge
    window.location=\"http://www.iexploit.org/index.php/javascript/level-5\";
    } else
    alert(\"Wrong password\");
    }
    //Coded by x3n0n --- iExploit Dev team --
    //Greetz to iExploit staff & members


    Example HTML page
    <html>
    <head>
    <title>test</title>
    <script type=\"text/javascript\" src=\"Challenge_four.js\"></script>
    </head>
    <body>
    <input type=\"button\" onclick=\"get_user()\" value=\"Login\"/>
    </body>
    </html>
  • Xin
    Posts: 3,251
    Good job keep them coming :)
    Xin