آژانس هواپیمایی

معرفی کدهای جالب برای وب سایت

شروع موضوع توسط Hamid2day ‏2 دسامبر 2007 در انجمن JavaScript , VBScript

  1. Hamid2day

    Hamid2day مدیر ارشد مدیر ارشد

    تاریخ عضویت:
    ‏1 مارس 2006
    نوشته ها:
    15,682
    تشکر شده:
    8,690
    محل سکونت:
    اوهایو
    كد آخرين تاريخ بروز شدن سايت شما رو کاربران نشون می ده..

    کد:
    <!-- Paste this code into the ‌BODY of your HTML document  -->
    <SCRIPT LANGUAGE="JavaScript">
    
    <!-- http://www.jostejoogar.ir -->
    
    <!-- Begin
    var m = "Page updated " + document.lastModified;
    var p = m.length-8;
    document.writeln("<center>");
    document.write(m.substring(p, 0));
    document.writeln("</center>");
    // End -->
    </SCRIPT>
    
    <!-- Script Size:  0.65 KB  -->
    
     
  2. Hamid2day

    Hamid2day مدیر ارشد مدیر ارشد

    تاریخ عضویت:
    ‏1 مارس 2006
    نوشته ها:
    15,682
    تشکر شده:
    8,690
    محل سکونت:
    اوهایو
    اين كد بشما امكان ميدهد در قسمت تيتل بار كاوشگر اينترنت خود ( IE ) نوشتهاي متحرك قرار دهيد.

    کد:
    <!-- Paste this code into the HEAD of your HTML document  -->
    
    
    <SCRIPT LANGUAGE="JavaScript">
    
    <!-- http://www.jostejoogar.ir -->
    
    <!-- Begin
    var message = new Array();
    // Set your messages you want typed into the title bar below.
    // To add more messages, just add more elements to the array.
    message[0] = "This script will type out in your title bar over and over...";
    message[1] = "followed by whatever you type here...";
    message[2] = "and then, whatever you choose to type here...";
    message[3] = "and so on...";
    message[4] = "and so on...";
    
    // Set the number of repetitions (how many times a given message is typed out
    // before moving onto the next message).
    var reps = 1;
    var speed = 275;// Set the overall typing speed (larger number = slower action).
    var hold = 4 // set the length of time to display the whole phrase before retyping (larger number = longer)
    
    // DO NOT EDIT BELOW THIS LINE.
    var p = message.length;
    var q = 0;
    var r = 0;
    var C = 0;
    var mC = 0;
    var s = 0;
    var sT = null;
    
    if (reps < 1) {
    reps = 1;
    }
    function setMessage() {
    typing = message[mC];
    q = typing.length;
    r = q + hold;
    typeMessage();
    }
    function typeMessage() {
    if (s > r) {
    s = 0;
    }
    if (s > q) {
    document.title = '|- '+ typing +' - - -';
    }
    else {
    document.title = '|- '+ typing.substr(0,s)+' - - -';
    }
    if (C < (r * reps)) {
    sT = setTimeout("typeMessage()", speed);
    C++;
    s++;
    }
    else {
    C = 0;
    s = 0;
    mC++;
    if(mC > p - 1) {mC = 0;}
    sT = null;
    setMessage();
       }
    }
    setMessage();
    //  End -->
    </script>
    
    
    <!-- Script Size:  2.01 KB --> 
     
  3. Hamid2day

    Hamid2day مدیر ارشد مدیر ارشد

    تاریخ عضویت:
    ‏1 مارس 2006
    نوشته ها:
    15,682
    تشکر شده:
    8,690
    محل سکونت:
    اوهایو
    Random Strings
    نوشته به صورت اتفاقی در صفحه

    کد:
    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
        <!--
            // Trivial and pointless little JavaScript to interpolate random
            // strings into a page.
        
        var sc = 10;                    // Number of alternative strings
        var s = new Array(sc);          // Array to hold alternative strings
        
        // String definitions. There should be exactly 'sc' strings, numbered
        // from 0 to (sc - 1). You can embed markup in the strings, provided
        // you're careful to escape any double quotes. Note that if you fail
        // to define enough strings, you'll get 'undefined' appearing in place
        // of the string, or possibly even a security violation, which tends
        // to be unaesthetic.
        
        s[0] = "She won't live, of course. But then again ... who does?";
        s[1] = "I seem to be having tremendous difficulty with my lifestyle.";
        s[2] = "Frog blast the vent core!";
        s[3] = "Pizza is a lot like sex. When it's good, it's really good. " +
                "When it's bad, it's still pretty good.";
        s[4] = "unix soit qui mal y pense";
        s[5] = "Wriggling grunion in your slipstream";
        s[6] = "I'm shocked to hear it. The Hyperdyne 400 series always " +
                  "were a bit twitchy.";
        s[7] = "I have the greatest enthusiasm for our mission, Dave.";
        s[8] = "Do not taunt Happy Fun Ball.";
        s[9] = "Do not look into laser with remaining good eye.";
        
        // pickRandom - Return a random number in a given range. If we're running
        // on an older browser that doesn't support 'Math.random()', we can fake
        // it by using the current time. This isn't ideal for mission-critical
        // security applications, but it's fine here. Note that we divide the
        // current time by 1000 to get rid of the milliseconds which Navigator
        // doesn't seem to take into account.
        
        function pickRandom(range) {
            if (Math.random)
                return Math.round(Math.random() * (range-1));
            else {
                var now = new Date();
                return (now.getTime() / 1000) % range;
            }
        }
        
        // Write the string into the document. The "<BLOCKQUOTE>" tags are just
        // for formatting; you can put as much or as little HTML around these
        // strings as you like.
        
        var choice = pickRandom(sc);
        document.writeln("<TABLE WIDTH=460 ALIGN=CENTER><TR><TD>" +
                         "<BLOCKQUOTE><BIG><B>" + s[choice] +
                         "<" + "/B><" + "/BIG><" + "/BLOCKQUOTE>" +
                         "<" + "/TD><" + "/TR><" + "/TABLE>");
        
        // --></SCRIPT>
     
  4. Hamid2day

    Hamid2day مدیر ارشد مدیر ارشد

    تاریخ عضویت:
    ‏1 مارس 2006
    نوشته ها:
    15,682
    تشکر شده:
    8,690
    محل سکونت:
    اوهایو
    غیر فعال کردن راست کلیک.

    لطفا کد مورد نظر رو در بین تگ های <body> و <body/> قرار دهید.

    کد:
    <script LANGUAGE="JavaScript">
    document.oncontextmenu=function(){return false}
    if(document.layers){window.captureEvents(Event.MOUSEDOWN);window.onmousedown=function(e){if(e.target==document)return false}}
    else{document.onmousedown=function(){return false}}
    function disableselect(e){return false}
    function reEnable(){return true}
    document.onselectstart=new Function("return false")
    if(window.sidebar){document.onmousedown=disableselect
    document.onclick=reEnable}
    </script>
    
     
  5. Hamid2day

    Hamid2day مدیر ارشد مدیر ارشد

    تاریخ عضویت:
    ‏1 مارس 2006
    نوشته ها:
    15,682
    تشکر شده:
    8,690
    محل سکونت:
    اوهایو
avanak عسل طبیعی و گرده گل ایرانی