JavaScript simulates typing effect
JavaScript can simulate the typing effect. It is a very creative little script that can be used as a 404 page. Of course, it can also be used in many places. First save the string that needs to be printed into an array in advance, and then use the setTimeout() method to output one character every short period of time, and the serial effect is like typing.
Code
<script type="text/javascript"> <!-- var tl = new Array( "I am so sorry, but I can't find the Page you've requested.", "It's possible that you entered the address incorrectly.", "If you did enter the address correctly, then it must be my fault.", "I am really, really sorry, but I've tried everything I know to find it.", "Nothing helped.", "I am really depressed about this.", "You see, I'm just a web server...", "...here I am, brain the size of the universe, trying to serve you a simple web page...", "And then it doesn't even exist!", "Where does that leave me?!", "I mean, I don't even know you.", "How should I know what you wanted from me?", "You honestly think I can 'guess' what someone I don't even 'know' wants to find here?", "", "Maybe I should introduce myself... my name is Marvin.", "But then again, what is the use of intruducing myself?", "You can't tell me your name, because you are in some far off place, sitting in front of your computer.", "And that makes me feel lonely.", "Do you know what that is like?", "", "...sigh...", "", "Man, I am so depressed I could just cry.", "And then where would we be, I ask you?", "It's not pretty when a web server cries.", "And where do you get off telling me what to show anyway?", "I'm just a web server...", "...and possibly a manic depressive one at that...", "So why does that give you the right to tell me what to do?", "Huh?", "", "I am so depressed...", "I think I'll crawl off into the trash can and decompose.", "I mean, I'm gonna be obsolete in what, two weeks anyway?", "What kind of a life is that?", "Two effing weeks...", "...and then I'll be replaced by a .01 release, that thinks it's God's gift to web servers,", "just because it doesn't have some tiddly little security hole with its HTTP POST implementation,", "or something like that.", "", "I'm really sorry to burden you with all this,", "I mean, it's not your job to listen to my problems,", "and I guess it is my job to go and fetch web pages for you.", "But I couldn't get this one.", "I am so sorry.", "Believe me!", "", "Maybe I could interest you in another page?", "There are a lot out there that are pretty neat, they say,", "although none of them were put on 'my' server, of course.", "Figures, huh?", "That makes me depressed too, since I have to serve them, all day and all night long.", "Two weeks of information overload, and then *pffftt*, consigned to the trash.", "Again I ask you, what kind of a life is that?", "", "Now, please let me sulk alone.", "", "", "", "", "I am so depressed.", "", "", "", "", "", "", "", "<connection terminated>" ); var speed = 50; var index = 0; text_pos = 0; var str_length = tl[0].length; var contents, row; function type_text() { contents=''; row = Math.max(0,index-7); while(row < index) { contents += tl[row++] + '\r\n'; } //document.forms[0].elements[0].value = contents + tl[index].substring(0,text_pos) + "_"; document.getElementById("typearea").value = contents + tl[index].substring(0,text_pos) + "_"; if(text_pos++==str_length) { text_pos=0; index++; if(index!=tl.length) { str_length=tl[index].length; setTimeout("type_text()",1500); } } else setTimeout("type_text()",speed); } //--> </script> <form> <textarea id="typearea" rows="20" cols="100" style="font-family:Arial; font-size:14px; "></textarea> </form> <script type="text/javascript">type_text();</script>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











WebSocket and JavaScript: Key technologies for realizing real-time monitoring systems Introduction: With the rapid development of Internet technology, real-time monitoring systems have been widely used in various fields. One of the key technologies to achieve real-time monitoring is the combination of WebSocket and JavaScript. This article will introduce the application of WebSocket and JavaScript in real-time monitoring systems, give code examples, and explain their implementation principles in detail. 1. WebSocket technology

How to use WebSocket and JavaScript to implement an online speech recognition system Introduction: With the continuous development of technology, speech recognition technology has become an important part of the field of artificial intelligence. The online speech recognition system based on WebSocket and JavaScript has the characteristics of low latency, real-time and cross-platform, and has become a widely used solution. This article will introduce how to use WebSocket and JavaScript to implement an online speech recognition system.

Introduction to how to use JavaScript and WebSocket to implement a real-time online ordering system: With the popularity of the Internet and the advancement of technology, more and more restaurants have begun to provide online ordering services. In order to implement a real-time online ordering system, we can use JavaScript and WebSocket technology. WebSocket is a full-duplex communication protocol based on the TCP protocol, which can realize real-time two-way communication between the client and the server. In the real-time online ordering system, when the user selects dishes and places an order

How to use WebSocket and JavaScript to implement an online reservation system. In today's digital era, more and more businesses and services need to provide online reservation functions. It is crucial to implement an efficient and real-time online reservation system. This article will introduce how to use WebSocket and JavaScript to implement an online reservation system, and provide specific code examples. 1. What is WebSocket? WebSocket is a full-duplex method on a single TCP connection.

JavaScript and WebSocket: Building an efficient real-time weather forecast system Introduction: Today, the accuracy of weather forecasts is of great significance to daily life and decision-making. As technology develops, we can provide more accurate and reliable weather forecasts by obtaining weather data in real time. In this article, we will learn how to use JavaScript and WebSocket technology to build an efficient real-time weather forecast system. This article will demonstrate the implementation process through specific code examples. We

JavaScript tutorial: How to get HTTP status code, specific code examples are required. Preface: In web development, data interaction with the server is often involved. When communicating with the server, we often need to obtain the returned HTTP status code to determine whether the operation is successful, and perform corresponding processing based on different status codes. This article will teach you how to use JavaScript to obtain HTTP status codes and provide some practical code examples. Using XMLHttpRequest

Usage: In JavaScript, the insertBefore() method is used to insert a new node in the DOM tree. This method requires two parameters: the new node to be inserted and the reference node (that is, the node where the new node will be inserted).

Introduction to the method of obtaining HTTP status code in JavaScript: In front-end development, we often need to deal with the interaction with the back-end interface, and HTTP status code is a very important part of it. Understanding and obtaining HTTP status codes helps us better handle the data returned by the interface. This article will introduce how to use JavaScript to obtain HTTP status codes and provide specific code examples. 1. What is HTTP status code? HTTP status code means that when the browser initiates a request to the server, the service
