In our last tutorial we covered JavaScript Errors. We learned to work with the OnError event, the Try...Catch statement, and Throw to create exceptions. In this episode we will go over JavaScript String Objects and learn to use them.
JavaScript Objects: Strings - The Big() Method (Page 5 of 6 )
The Big method allows us to create text that is..well...uhhh...big. Here is a sample:
<html>
<body>
<script type="text/javascript">
var example="THIS IS BIG AND BEAUTIFUL TEXT!"
document.write("<p>This is normal text <br /><br />" + example.big() + "</p>")
</script>
</body>
</html>
This is the print out from the above code:
This is normal text
THIS IS BIG AND BEAUTIFUL TEXT!
As you can see, we create a variable named example and store some text in it. Then we print an example of normal text using the document.write command, followed by an example of big text, using the example.big() method.
The Blink() Method
While it does not work in Internet Explorer, the Blink() method is still pretty cool. In other browsers it creates blinking text. In Internet Explorer it simply displays the text as normal.