1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Konami Code modification

Discussion in 'JavaScript' started by jinch, Nov 18, 2012.

  1. #1
    Hello,

    I'm using the following code to display a Konami Code on my website.

    <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
            <script type="text/javascript" src="konami.js"></script>
            <script type="text/javascript">
                $(document).ready(function(){
                    $(window).konami(function(){
                        alert('Konami Code Activated');
                    });
                });
    </script>
    
    Code (markup):
    I don't want an alert when the Konami Code has been entered, I would like the same effect that the one on this page :
    http://snaptortoise.com/konami-js/

    Any idea on how to modify my script to do it ?

    Best regards,
     
    jinch, Nov 18, 2012 IP
  2. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #2
    They have a few examples, but if you want to redirect to a different site,

    Replace the line
    alert('bla bla');

    with this
    window.location = 'http://google.com';
     
    crath, Nov 18, 2012 IP
  3. jinch

    jinch Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Thanks for your answer.

    window.location = 'http://google.com'; is good but you still see the url in browser.

    If you do the konami code on this page : http://snaptortoise.com/konami-js/
    The page will change but the url will stay the same. This is what I want.
     
    jinch, Nov 18, 2012 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    I don't see any place to submit anything on the page, but "The page will change but the url will stay the same" can mean that the page is using AJAX to change text on the page.
     
    Rukbat, Nov 22, 2012 IP