Home arrow JavaScript arrow Page 5 - JavaScript Objects: Strings
JAVASCRIPT

JavaScript Objects: Strings


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.

Author Info:
By: James Payne
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
January 14, 2008
TABLE OF CONTENTS:
  1. · JavaScript Objects: Strings
  2. · Length Property
  3. · Prototype
  4. · The Anchor() Method
  5. · The Big() Method
  6. · The Bold() Method

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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.


<html>

<body>


<script type="text/javascript">


var blinking="Now you see me now you don't!"



document.write("Blink: " + blinking.blink())

</script>


</body>

</html>

This results in: Blink:Now you see me now you don't!


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials