Results 1 to 3 of 3

Thread: Magic Slate script not working in firefox. WHY ?

  1. #1
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Magic Slate script not working in firefox. WHY ?

    Code:
    <SCRIPT type="text/javascript" language="javascript" id="clientEventHandlersJS">
    			var st=" Mein to pagal ho gaya hoon! mera dimag kharab ho gaya hain! kaam kar kar ke mein dukhi ho chuka hoon is company mein?";
    			st+=" Arey ye kya ho raha hai? mujhe kya type karne ko kaha aur mein kya type kar raha hun. Kya kaam karte karte mera dimaag itna ghoom gayaa hai..ki mein kuch aur soch hi nahin paa raha hoon....hey bhagwaan yeh mujhe kahan pe fasaa diya re tune...kaise kaise log..aur kaise hai yeh comany... i see i see i.....";
    			st+="Mujhe yeh sab likhna nahin hai. Mujhe kisi aise ka naam likhna hai  jisko mein sabse zyaada pasand karte hun.";
    			st+="  ";
    			st+=" buffalo buffalo.buffalo buffalo.buffalo buffalo.buffalo buffalo";
    			st+="  miss u always";
    			st+=" i love u my buffalo";
    			st+=" u know i m dying to marry u .my buffalo..........";
    			st+=" luv u buffalo darling                  ";
    			st+=" HAHAHAHHAHAHAAAAAAAAAAAAAAAAAAAAAAAAAA                  ";
    			var s="";
    			var i=0;
    			function window_onload() {
    				textarea1.focus();
    			}
    			function textarea1_onkeydown() {
    				s+=st.charAt(i);
    				i++;
    				if(i>=st.length)
    					i=0;
    				textarea1.value=s;
    			}
    
    		</SCRIPT>
    Code:
    <TEXTAREA language="javascript" id="textarea1" onkeydown="return textarea1_onkeydown()" name="textarea1" rows="12" cols="66"></TEXTAREA>
    Page link:
    http://www.funarulez.com/fun/magic-slate.htm

    IE: Working
    FF: Not
    Last edited by FunaGuy; 01-13-2008 at 03:51 AM. Reason: to add magic slate link

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I'd write it more like this:
    Code:
    <textarea id="textarea1" onkeydown="this.value = st.substr(0, this.value.length);" name="textarea1" rows="12" cols="66"></textarea>
    The textarea_onkeydown function is superfluous, as are the variables s and i.

    Don't forget to validate your HTML (as HTML 4.01 Strict).
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Twey !

    Its works !!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •