/    Sign up×
Community /Pin to ProfileBookmark

Cool script – but don’t work

I, a newbiez, combined 3 cool scripts into one, and it almost works.

[list=1]

  • [*]

    Displaying a random message from an array of message.


  • [*]

    Continuously refreshing message after a short pause.


  • [*]

    Each message when appears on the screen like being typed.


  • [/list]

    Well! They all work except that just the first message was typed, and all others appear instantly.

    You can look [URL=http://25er.com/]http://25er.com/[/URL]

    Please someone look at it to see what wrong, I enclose the code bellow. Note that the messages are in Vietnamese, but that doesn’t interfere with your help. Thanks in advance.

    [code]
    <html>

    <head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
    <meta http-equiv=”description” content=”S&#297; Quan H&#7843;i Quân khoá 25 – C&#417; quan ngôn lu&#7853;n chính th&#7913;c c&#7911;a SQHQ-25″>
    <meta http-equiv=”keywords” content=”S&#297; Quan H&#7843;i Quân khoá 25, SQHQ-25, sqhq25, 25er, 25ers”>
    <meta http-equiv=”Refresh” CONTENT=”600;URL=http://www.25er.com/forum/index.php”>
    <meta name=”GENERATOR” content=”Microsoft FrontPage 5.0″>
    <title>S&#297; Quan H&#7843;i Quân khoá 25</title>
    </head>

    <body bgcolor=”#FFFFFF” text=”#1C5A00″ link=”#800000″ vlink=”#1C5A00″ alink=”#FFFFFF”>
    <p align=”center”>&nbsp;</p>
    <p align=”center”>&nbsp;</p>
    <p align=”center”>&nbsp;</p>
    <p align=”center”>&nbsp;</p>
    <div align=”center”><center>
    <table border=”0″ width=”428″ cellspacing=”0″ bordercolorlight=”#FFFFFF” bordercolordark=”#FFFFFF” bgcolor=”#FFFFFF” cellpadding=”0″ style=”border-collapse: collapse” bordercolor=”#111111″ >
    <tr>
    <td width=”100%” align=”center” height=”1″>
    <img src=”http://www.25er.com/images/logo250.jpg”
    alt=”S&#297; Quan H&#7843;i Quân khoá 25″ border=”0″ align=”left” width=”100″ height=”209″>
    </td>
    <td width=”50%” align=”center” height=”1″></td>
    <td width=”50%” align=”left” height=”1″>
    <table border=”0″ cellspacing=”0″ style=”border-collapse: collapse” bordercolor=”#111111″ width=”100%” cellpadding=”0″ id=”AutoNumber1″ height=”30″>
    <tr>
    <td width=”100%” height=”24″ colspan=”2″>
    <embed height=0 width=0 console=”clip1″ hidden=”true” autostart=”true” loop=”true” controls=”all” type=”audio/x-pn-realaudio-plugin” src=”http://68.5.151.251:4027/vobivietnam/khoa/k26/luuniemk26/music/realaudio/hqhk.rm”></td>
    <td width=”100%” height=”1″>
    </td>
    </tr>
    <tr>
    <td width=”100%” height=”47″ colspan=”2″>
    </td>
    <td width=”100%” height=”19″>
    &nbsp;</td>
    </tr>
    <tr>
    <td width=”100%” height=”112″ colspan=”2″>
    <div id=”quote” style=”font-family:Arial; font-size=10pt; color=#0000aa; style=visibility:hidden; width:426; height:97″></div>
    </td>
    </tr>
    <tr>
    <td width=”82%” height=”4″>
    <img src=”http://www.25er.com/images/anchor1sm.jpg” align=”right” border=”0″ alt=”B&#7845;m &#273;ây &#273;&#7875; trình di&#7879;n h&#7841;m ki&#7873;u.”>
    </tr>
    <td width=”18%” height=”4″>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </center></div>

    <script LANGUAGE=”JavaScript”>
    <!–

    // Code by Mark Sottek. Ask before using please. [email][email protected][/email]
    /*
    Typing Text Script-
    Last updated: 99/06/17
    © Dynamic Drive ([url]www.dynamicdrive.com[/url])
    For full source code, installation instructions,
    100’s more DHTML scripts, and Terms Of
    Use, visit dynamicdrive.com
    */

    quotes = new Array(5);

    authors = new Array(5);

    quotes[0] = “&#272;&#7879; trình cùng các quan 25, &#273;ây là m&#7897;t ví d&#7909; c&#7911;a trang web SQHQ25.com. &#272;àn em s&#7869; t&#7915; t&#7889;n b&#7867; góc phát tri&#7875;n thêm c&#7843; v&#7873; n&#7897;i dung và hình th&#7913;c. N&#7871;u các quan &#273;&#7891;ng ý cho &#273;àn em tho&#7843;i mái, chúng ta s&#7869; có m&#7897;t trang web (cùng v&#7899;i m&#7897;t di&#7877;n &#273;àn) nh&#432; là m&#7897;t ph&#432;&#417;ng ti&#7879;n liên l&#7841;c và thông tin.”;
    authors[0] = ” — Th/U Chen”;

    quotes[1] = “Hi&#7879;n bây gi&#7901; thì ch&#432;a hoàn h&#7843;o, nh&#432;ng trong m&#7897;t th&#7901;i gian vài tu&#7847;n chúng ta s&#7869; th&#7845;y s&#7921; ti&#7871;n tri&#7875;n. Ít nh&#7845;t là v&#7873; design.”;
    authors[1] = “”;

    quotes[2] = “Design c&#7911;a trang nhà l&#7869; d&#297; nhiên không ph&#7843;i &#273;&#7865;p nh&#7845;t và ch&#7881; T&#7840;M B&#7906; trong th&#7901;i gian này. N&#7871;u quan có design nào khác h&#417;n, xin liên l&#7841;c v&#7899;i Th/U Ch&#7871;n &#273;&#7875; &#273;&#432;a lên cho b&#7841;n bè ng&#7855;m.”;
    authors[2] = “”;

    quotes[3] = “Chúng ta &#273;ã th&#7845;y design c&#7911;a Th/U Kè, và hình nh&#432; Th/U PhúcCC c&#361;ng s&#7869; ra lò m&#7897;t design nh&#432; Star War. T&#7845;t c&#7843; s&#7869; &#273;&#432;&#7907;c &#273;em lên và t&#7845;t c&#7843; các quan 25 s&#7869; vote cái nào &#273;&#7865;p và ý ngh&#297;a nh&#7845;t và chúng ta s&#7869; dùng cái &#273;ó làm trang nhà c&#7911;a SQHQ25.com.”;
    authors[3] = “”;

    quotes[4] = “Hy v&#7885;ng s&#7869; còn nhi&#7873;u design khác ngoài nh&#7919;ng designs c&#7911;a Kè, PhúcCC, và Ch&#7871;n cho chúng ta l&#7921;c ch&#7885;n. Thí d&#7909; nh&#432; t&#7915; Phi V&#259;n Ngh&#7879;, Thi&#7879;p, Con Ma vân vân …”;
    authors[4] = “”;

    var it = 0
    function initialize(){
    var div = document.getElementById(‘quote’);
    mytext = div.innerHTML
    var myheight = div.offsetHeight
    div.innerHTML = ”
    typeit()
    }

    function typeit(){
    var div = document.getElementById(‘quote’);
    div.insertAdjacentText(“beforeEnd”,mytext.charAt(it))
    if (it < mytext.length-1){
    it++
    setTimeout(“typeit()”,10)
    }
    else {
    return
    }
    }

    function randomQuote() {
    var str, div = document.getElementById(‘quote’);
    index = Math.floor(Math.random() * quotes.length);
    str= quotes[index];
    str+= authors[index];
    div.innerHTML = str;
    if (document.all) document.body.onload = initialize
    }

    randomQuote();
    window.setInterval(“randomQuote()”,5000);

    //done –>

    </script>
    </body>
    </html>
    [/code]

    .

    to post a comment
    JavaScript

    0Be the first to comment 😎

    ×

    Success!

    Help @ngungo spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...