Sunday, October 16, 2011

Some Useful JavaScript Tricks

JavaScript can be one of the most useful additions to any web
page. It comes bundled with Microsoft Internet Explorer and
Netscape Navigator and it allows us to perform field validations,
mouse-overs images, open popup windows, and a slew of other
things.

In this article I will show you how to:

- Display the browser name and version number
- Change the text in the status bar of the browser
- Use an input box to get text from the user
- Use a message box to display text to the user
- Change the title of the browser window

Before that, however, we need to know how to setup our web page
so that it can run the JavaScript. JavaScript code is inserted
between opening and closing script tags: ,
like this:

These script tags can be placed anywhere on the page, however
it's common practice to place them between the and
tags. A basic HTML page that contains some JavaScript looks
like this:



My Test Page < itle><BR><script language="JavaScript"></P><P><a href="http://caae7yl1b5ew14i6u-lbp0wp65.hop.clickbank.net/">fun</a>ction test<a href="http://caae7yl1b5ew14i6u-lbp0wp65.hop.clickbank.net/">fun</a>c()<BR>{<BR>var x = 1;<BR>}</P><P></script><BR></head><BR><body><BR><h1>Hello</h1><BR></body><BR></html></P><P>For the examples in this article, you should use the basic<BR>document format I have just shown you, inserting the JavaScript<BR>code between the <script> and </script> tags. When you load the<BR>page in your browser, the JavaScript code will be executed<BR>automatically.</P><P>-----------------------------------------------<BR>Displaying the browsers name and version number<BR>-----------------------------------------------</P><P>The "navigator" object in JavaScript contains the details of the<BR>users browser, including its name and version number. We can<BR>display them in our browser using the document.write <a href="http://caae7yl1b5ew14i6u-lbp0wp65.hop.clickbank.net/">fun</a>ction:</P><P>document.write("Your browser is: " + navigator.appName);<BR>document.write("<BR>Its version is: " + navigator.appVersion);</P><P>I run Windows 2000 and <a href="http://35dca070e2805xkm2yr-s0ojx4.hop.clickbank.net/">Internet</a> Explorer version 6, so the output<BR>from the code above looks like this in my browser window:</P><P>Your browser is: Microsoft <a href="http://35dca070e2805xkm2yr-s0ojx4.hop.clickbank.net/">Internet</a> Explorer<BR>Its version is: 4.0 (compatible; MSIE 6.0b; Windows NT 5.0)</P><P>-----------------------------------------------<BR>Changing the text in the status bar of the browser<BR>-----------------------------------------------</P><P>To change the text in the status bar of a browser window, we just<BR>change the "status" member of the "window" object, which<BR>represents our entire browser window:</P><P>window.status = "This is some text";</P><P>-----------------------------------------------<BR>Using an input box to get text from the user<BR>-----------------------------------------------</P><P>Just like in traditional windows applications, we can use an<BR>input box to get some text input from the user. The "prompt"<BR><a href="http://caae7yl1b5ew14i6u-lbp0wp65.hop.clickbank.net/">fun</a>ction is all we need:</P><P>var name = prompt("What is your name?");<BR>document.write("Hello " + name);</P><P>The prompt <a href="http://caae7yl1b5ew14i6u-lbp0wp65.hop.clickbank.net/">fun</a>ction accepts just one argument (the title of the<BR>input box), and returns the value entered into the text box. In<BR>the example above, we get the users name and store it in the<BR>"name" variable. We then use the "document.write" <a href="http://caae7yl1b5ew14i6u-lbp0wp65.hop.clickbank.net/">fun</a>ction to<BR>output their name into the browser window.</P><P>-----------------------------------------------<BR>Using a message box to display text to the user<BR>-----------------------------------------------</P><P>We can display a message box containing an OK button. These<BR>are great when you want to let the user know what is happening<BR>during their time on a particular page. We can use a message box<BR>to display the "name" variable from our previous example:</P><P>var name = prompt("What is your name?");<BR>alert("Your name is: " + name);</P><P>The "alert" <a href="http://caae7yl1b5ew14i6u-lbp0wp65.hop.clickbank.net/">fun</a>ction takes one argument, which is the text to<BR>display inside of the message box.</P><P>-----------------------------------------------<BR>Changing the title of the browser window<BR>-----------------------------------------------</P><P>To change the title of our web browser's window, we simply modify<BR>the "document.title" variable, like this:</P><P>document.title = "My new title";</P><P>One bad thing about the "document.title" variable is that we can<BR>only manipulate it in Microsoft <a href="http://35dca070e2805xkm2yr-s0ojx4.hop.clickbank.net/">Internet</a> Explorer. Netscape's<BR>implementation of JavaScript doesn't allow us to modify it.</P><P>-----------------------------------------------<BR>In Closing<BR>-----------------------------------------------</P><P>As you can see from the examples in this article, JavaScript is a<BR>powerful scripting language that we can use to enhance our<BR>visitors experience with our site. You shouldn't use JavaScript<BR>too much, however, because in some cases it can annoy your<BR>visitors and send them packing before your site even loads! </P><P>Mitchell Harper is the founder of http://www.devarticles.com/.<BR>DevArticles provides its visitors with useful, informative<BR>articles on ASP, PHP, and.NET, as well as heaps of tips and<BR>tricks that you wont find anywhere else! To see what it's all<BR>about, visit devArticles right now at http://www.devarticles.com/</P><br /><p><a href="http://goarticles.com/article/Some-Useful-JavaScript-Tricks/4206/" target="_blank" rel="nofollow">View the original article here</a></p> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/04523759588252987709' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/04523759588252987709' rel='author' title='author profile'> <span itemprop='name'>Bosss Corporation Blogs</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://javascriptfornewbies.blogspot.com/2011/10/some-useful-javascript-tricks.html' itemprop='url'/> <a class='timestamp-link' href='https://javascriptfornewbies.blogspot.com/2011/10/some-useful-javascript-tricks.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2011-10-16T18:03:00-07:00'>6:03 PM</abbr></a> </span> <span class='post-comment-link'> </span> <span class='post-icons'> <span class='item-action'> <a href='https://www.blogger.com/email-post/7977524528241239409/5319357163832593944' title='Email Post'> <img alt='' class='icon-action' height='13' src='https://resources.blogblog.com/img/icon18_email.gif' width='18'/> </a> </span> <span class='item-control blog-admin pid-414852250'> <a href='https://www.blogger.com/post-edit.g?blogID=7977524528241239409&postID=5319357163832593944&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=7977524528241239409&postID=5319357163832593944&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=7977524528241239409&postID=5319357163832593944&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=7977524528241239409&postID=5319357163832593944&target=twitter' target='_blank' title='Share to X'><span class='share-button-link-text'>Share to X</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=7977524528241239409&postID=5319357163832593944&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=7977524528241239409&postID=5319357163832593944&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> Labels: <a href='https://javascriptfornewbies.blogspot.com/search/label/JavaScript' rel='tag'>JavaScript</a>, <a href='https://javascriptfornewbies.blogspot.com/search/label/Tricks' rel='tag'>Tricks</a>, <a href='https://javascriptfornewbies.blogspot.com/search/label/Useful' rel='tag'>Useful</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> <div class='comments' id='comments'> <a name='comments'></a> <h4>No comments:</h4> <div id='Blog1_comments-block-wrapper'> <dl class='avatar-comment-indent' id='comments-block'> </dl> </div> <p class='comment-footer'> <div class='comment-form'> <a name='comment-form'></a> <h4 id='comment-post-message'>Post a Comment</h4> <p> </p> <a href='https://www.blogger.com/comment/frame/7977524528241239409?po=5319357163832593944&hl=en&saa=85391&origin=https://javascriptfornewbies.blogspot.com' id='comment-editor-src'></a> <iframe allowtransparency='true' class='blogger-iframe-colorize blogger-comment-from-post' frameborder='0' height='410px' id='comment-editor' name='comment-editor' src='' width='100%'></iframe> <script src='https://www.blogger.com/static/v1/jsbin/3790099508-comment_from_post_iframe.js' type='text/javascript'></script> <script type='text/javascript'> BLOG_CMT_createIframe('https://www.blogger.com/rpc_relay.html'); </script> </div> </p> </div> </div> <div class='inline-ad'> <script type="text/javascript"><!-- google_ad_client="pub-6767316913107449"; google_ad_host="pub-1556223355139109"; google_ad_width=336; google_ad_height=280; google_ad_format="336x280_as"; google_ad_type="text_image"; google_ad_host_channel="0001"; google_color_border="FFF9EE"; google_color_bg="FFF9EE"; google_color_link="993300"; google_color_url="666555"; google_color_text="222222"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </div></div> </div> <div class='blog-pager' id='blog-pager'> <span id='blog-pager-newer-link'> <a class='blog-pager-newer-link' href='https://javascriptfornewbies.blogspot.com/2011/10/grow-your-subscribers-exponentially.html' id='Blog1_blog-pager-newer-link' title='Newer Post'>Newer Post</a> </span> <span id='blog-pager-older-link'> <a class='blog-pager-older-link' href='https://javascriptfornewbies.blogspot.com/2011/10/ifuturz-offers-flash-development-custom.html' id='Blog1_blog-pager-older-link' title='Older Post'>Older Post</a> </span> <a class='home-link' href='https://javascriptfornewbies.blogspot.com/'>Home</a> </div> <div class='clear'></div> <div class='post-feeds'> <div class='feed-links'> Subscribe to: <a class='feed-link' href='https://javascriptfornewbies.blogspot.com/feeds/5319357163832593944/comments/default' target='_blank' type='application/atom+xml'>Post Comments (Atom)</a> </div> </div> </div></div> </div> </div> <div class='column-left-outer'> <div class='column-left-inner'> <aside> </aside> </div> </div> <div class='column-right-outer'> <div class='column-right-inner'> <aside> <div class='sidebar section' id='sidebar-right-1'><div class='widget Subscribe' data-version='1' id='Subscribe1'> <div style='white-space:nowrap'> <h2 class='title'>Subscribe To</h2> <div class='widget-content'> <div class='subscribe-wrapper subscribe-type-POST'> <div class='subscribe expanded subscribe-type-POST' id='SW_READER_LIST_Subscribe1POST' style='display:none;'> <div class='top'> <span class='inner' onclick='return(_SW_toggleReaderList(event, "Subscribe1POST"));'> <img class='subscribe-dropdown-arrow' src='https://resources.blogblog.com/img/widgets/arrow_dropdown.gif'/> <img align='absmiddle' alt='' border='0' class='feed-icon' src='https://resources.blogblog.com/img/icon_feed12.png'/> Posts </span> <div class='feed-reader-links'> <a class='feed-reader-link' href='https://www.netvibes.com/subscribe.php?url=https%3A%2F%2Fjavascriptfornewbies.blogspot.com%2Ffeeds%2Fposts%2Fdefault' target='_blank'> <img src='https://resources.blogblog.com/img/widgets/subscribe-netvibes.png'/> </a> <a class='feed-reader-link' href='https://add.my.yahoo.com/content?url=https%3A%2F%2Fjavascriptfornewbies.blogspot.com%2Ffeeds%2Fposts%2Fdefault' target='_blank'> <img src='https://resources.blogblog.com/img/widgets/subscribe-yahoo.png'/> </a> <a class='feed-reader-link' href='https://javascriptfornewbies.blogspot.com/feeds/posts/default' target='_blank'> <img align='absmiddle' class='feed-icon' src='https://resources.blogblog.com/img/icon_feed12.png'/> Atom </a> </div> </div> <div class='bottom'></div> </div> <div class='subscribe' id='SW_READER_LIST_CLOSED_Subscribe1POST' onclick='return(_SW_toggleReaderList(event, "Subscribe1POST"));'> <div class='top'> <span class='inner'> <img class='subscribe-dropdown-arrow' src='https://resources.blogblog.com/img/widgets/arrow_dropdown.gif'/> <span onclick='return(_SW_toggleReaderList(event, "Subscribe1POST"));'> <img align='absmiddle' alt='' border='0' class='feed-icon' src='https://resources.blogblog.com/img/icon_feed12.png'/> Posts </span> </span> </div> <div class='bottom'></div> </div> </div> <div class='subscribe-wrapper subscribe-type-PER_POST'> <div class='subscribe expanded subscribe-type-PER_POST' id='SW_READER_LIST_Subscribe1PER_POST' style='display:none;'> <div class='top'> <span class='inner' onclick='return(_SW_toggleReaderList(event, "Subscribe1PER_POST"));'> <img class='subscribe-dropdown-arrow' src='https://resources.blogblog.com/img/widgets/arrow_dropdown.gif'/> <img align='absmiddle' alt='' border='0' class='feed-icon' src='https://resources.blogblog.com/img/icon_feed12.png'/> Comments </span> <div class='feed-reader-links'> <a class='feed-reader-link' href='https://www.netvibes.com/subscribe.php?url=https%3A%2F%2Fjavascriptfornewbies.blogspot.com%2Ffeeds%2F5319357163832593944%2Fcomments%2Fdefault' target='_blank'> <img src='https://resources.blogblog.com/img/widgets/subscribe-netvibes.png'/> </a> <a class='feed-reader-link' href='https://add.my.yahoo.com/content?url=https%3A%2F%2Fjavascriptfornewbies.blogspot.com%2Ffeeds%2F5319357163832593944%2Fcomments%2Fdefault' target='_blank'> <img src='https://resources.blogblog.com/img/widgets/subscribe-yahoo.png'/> </a> <a class='feed-reader-link' href='https://javascriptfornewbies.blogspot.com/feeds/5319357163832593944/comments/default' target='_blank'> <img align='absmiddle' class='feed-icon' src='https://resources.blogblog.com/img/icon_feed12.png'/> Atom </a> </div> </div> <div class='bottom'></div> </div> <div class='subscribe' id='SW_READER_LIST_CLOSED_Subscribe1PER_POST' onclick='return(_SW_toggleReaderList(event, "Subscribe1PER_POST"));'> <div class='top'> <span class='inner'> <img class='subscribe-dropdown-arrow' src='https://resources.blogblog.com/img/widgets/arrow_dropdown.gif'/> <span onclick='return(_SW_toggleReaderList(event, "Subscribe1PER_POST"));'> <img align='absmiddle' alt='' border='0' class='feed-icon' src='https://resources.blogblog.com/img/icon_feed12.png'/> Comments </span> </span> </div> <div class='bottom'></div> </div> </div> <div style='clear:both'></div> </div> </div> <div class='clear'></div> </div><div class='widget AdSense' data-version='1' id='AdSense1'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-6767316913107449"; google_ad_host="pub-1556223355139109"; google_alternate_ad_url="http://img2.blogblog.com/img/blogger_ad.html"; google_ad_width=200; google_ad_height=200; google_ad_format="200x200_as"; google_ad_type="text_image"; google_ad_host_channel="0001"; google_color_border="FFF9EE"; google_color_bg="FFF9EE"; google_color_link="000000"; google_color_url="993300"; google_color_text="222222"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div class='clear'></div> </div> </div><div class='widget BlogList' data-version='1' id='BlogList1'> <h2 class='title'>My Blog List</h2> <div class='widget-content'> <div class='blog-list-container' id='BlogList1_container'> <ul id='BlogList1_blogs'> <li style='display: block;'> <div class='blog-icon'> <img data-lateloadsrc='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_umQP1lqVvk35SQ4vK0yHD80zuqwbRYkLwMP2GF0bKFx42Kr75Ye3mn4CHGh0Bgu1rwjzykuIPUwonqZz2jXJzJmmPSA19aDFbmYnS4BhgEcKYdpw=s16-w16-h16' height='16' width='16'/> </div> <div class='blog-content'> <div class='blog-title'> <a href='http://daytradingbasics.blogspot.com/' target='_blank'> day trading</a> </div> <div class='item-content'> <span class='item-title'> <a href='http://daytradingbasics.blogspot.com/2012/06/day-trading-blog-can-help-or-break-your.html' target='_blank'> Day Trading Blog Can Help Or Break Your Business </a> </span> - <span class='item-snippet'> The trend of blogging gave birth to a multitude of tools and programs helping personal bloggers and corporate users. One of the toughest jobs being faced ... </span> <div class='item-time'> 14 years ago </div> </div> </div> <div style='clear: both;'></div> </li> <li style='display: block;'> <div class='blog-icon'> <img data-lateloadsrc='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uvT60T6ji8neTfvj_FoTNq2VICBKaH7hAldCVXxn8XWCfQa4FUv_gi9aXjG7t-Fn6J5SHP4mgjhI-GSR_hBMVCyYQjoNQR367QEqSqx9gmODPlog=s16-w16-h16' height='16' width='16'/> </div> <div class='blog-content'> <div class='blog-title'> <a href='http://estatetrustplans.blogspot.com/' target='_blank'> Estate Trust Plans</a> </div> <div class='item-content'> <span class='item-title'> <a href='http://estatetrustplans.blogspot.com/2011/12/why-everyone-needs-at-least-living.html' target='_blank'> Why Everyone Needs at Least a Living Trust </a> </span> - <span class='item-snippet'> There is one thing we all share in common: our days on this planet will come to an end - probably by surprise. That is about as basic a 'common denominat... </span> <div class='item-time'> 14 years ago </div> </div> </div> <div style='clear: both;'></div> </li> <li style='display: block;'> <div class='blog-icon'> <img data-lateloadsrc='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_ubaCPbIdZcmfPs4dmshnZj51IGeHd3iHmahoKmn_z-Quy9Gl68Y66PX9nBtKoA8v0PHy-pyl8LPNI4jAe3SJKf8hzaV1rxLT83Hg=s16-w16-h16' height='16' width='16'/> </div> <div class='blog-content'> <div class='blog-title'> <a href='http://mlmrank.blogspot.com/feeds/posts/default' target='_blank'> MLMRANK</a> </div> <div class='item-content'> <span class='item-title'> <!--Can't find substitution for tag [item.itemTitle]--> </span> - <span class='item-snippet'> <!--Can't find substitution for tag [item.itemSnippet]--> </span> <div class='item-time'> <!--Can't find substitution for tag [item.timePeriodSinceLastUpdate]--> </div> </div> </div> <div style='clear: both;'></div> </li> <li style='display: block;'> <div class='blog-icon'> <img data-lateloadsrc='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_szcsa7Z3KhyFfPvubx5Pgb6GWU1bPHHf_J4w6kHAtJ9P4YHRRDAcmREoPIgAEGXfIHIgZwAiB-e6GBf9tqvhuOx6uqjK-Miu7dxHT4L_6TmizLJ4vhyd7Cf_tRIg=s16-w16-h16' height='16' width='16'/> </div> <div class='blog-content'> <div class='blog-title'> <a href='http://certificationwithcomputer.blogspot.com/feeds/posts/default' target='_blank'> Certification With Computer</a> </div> <div class='item-content'> <span class='item-title'> <!--Can't find substitution for tag [item.itemTitle]--> </span> - <span class='item-snippet'> <!--Can't find substitution for tag [item.itemSnippet]--> </span> <div class='item-time'> <!--Can't find substitution for tag [item.timePeriodSinceLastUpdate]--> </div> </div> </div> <div style='clear: both;'></div> </li> <li style='display: block;'> <div class='blog-icon'> <img data-lateloadsrc='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uJAuDt3su5jgA4mlBgCsB0NIDMIwJAEcL5IBSTCj9ZbltPcWfmZ9LZ6VA9ZL9W_dJMZhAmSI5G-uXcmC_kaMNNTzQAc9bywLfxidJhXwxbEkJ25Kw9b5BL=s16-w16-h16' height='16' width='16'/> </div> <div class='blog-content'> <div class='blog-title'> <a href='http://tradingcurrencysafely.blogspot.com/feeds/posts/default' target='_blank'> trading currency in a unstable economy</a> </div> <div class='item-content'> <span class='item-title'> <!--Can't find substitution for tag [item.itemTitle]--> </span> - <span class='item-snippet'> <!--Can't find substitution for tag [item.itemSnippet]--> </span> <div class='item-time'> <!--Can't find substitution for tag [item.timePeriodSinceLastUpdate]--> </div> </div> </div> <div style='clear: both;'></div> </li> <li style='display: block;'> <div class='blog-icon'> <img data-lateloadsrc='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_up9paMI_-7HFNShbG-gdl6ZrRKYnpxxURYDISRSn5SBOSQNu5GcugjF_swMD2dbLhsjdqFQn77OrnLw5Y3c9s2j4eEAVQKQAiwDJV9JOIBxBfJekPCgF3lD1XIAVp15iw=s16-w16-h16' height='16' width='16'/> </div> <div class='blog-content'> <div class='blog-title'> <a href='http://bankloanswithlowinterestrates.blogspot.com/feeds/posts/default' target='_blank'> Bank money by knowing the loop holes</a> </div> <div class='item-content'> <span class='item-title'> <!--Can't find substitution for tag [item.itemTitle]--> </span> - <span class='item-snippet'> <!--Can't find substitution for tag [item.itemSnippet]--> </span> <div class='item-time'> <!--Can't find substitution for tag [item.timePeriodSinceLastUpdate]--> </div> </div> </div> <div style='clear: both;'></div> </li> </ul> <div class='clear'></div> </div> </div> </div><div class='widget Followers' data-version='1' id='Followers1'> <h2 class='title'>Followers</h2> <div class='widget-content'> <div id='Followers1-wrapper'> <div style='margin-right:2px;'> <div><script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <div id="followers-iframe-container"></div> <script type="text/javascript"> window.followersIframe = null; function followersIframeOpen(url) { gapi.load("gapi.iframes", function() { if (gapi.iframes && gapi.iframes.getContext) { window.followersIframe = gapi.iframes.getContext().openChild({ url: url, where: document.getElementById("followers-iframe-container"), messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER, messageHandlers: { '_ready': function(obj) { window.followersIframe.getIframeEl().height = obj.height; }, 'reset': function() { window.followersIframe.close(); followersIframeOpen("https://www.blogger.com/followers/frame/7977524528241239409?colors\x3dCgt0cmFuc3BhcmVudBILdHJhbnNwYXJlbnQaByMyMjIyMjIiByM5OTMzMDAqByNmZmY5ZWUyByMwMDAwMDA6ByMyMjIyMjJCByM5OTMzMDBKByM5OTk5OTlSByM5OTMzMDBaC3RyYW5zcGFyZW50\x26pageSize\x3d21\x26hl\x3den\x26origin\x3dhttps://javascriptfornewbies.blogspot.com"); }, 'open': function(url) { window.followersIframe.close(); followersIframeOpen(url); } } }); } }); } followersIframeOpen("https://www.blogger.com/followers/frame/7977524528241239409?colors\x3dCgt0cmFuc3BhcmVudBILdHJhbnNwYXJlbnQaByMyMjIyMjIiByM5OTMzMDAqByNmZmY5ZWUyByMwMDAwMDA6ByMyMjIyMjJCByM5OTMzMDBKByM5OTk5OTlSByM5OTMzMDBaC3RyYW5zcGFyZW50\x26pageSize\x3d21\x26hl\x3den\x26origin\x3dhttps://javascriptfornewbies.blogspot.com"); </script></div> </div> </div> <div class='clear'></div> </div> </div><div class='widget BlogArchive' data-version='1' id='BlogArchive1'> <h2>Blog Archive</h2> <div class='widget-content'> <div id='ArchiveList'> <div id='BlogArchive1_ArchiveList'> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://javascriptfornewbies.blogspot.com/2011/'> 2011 </a> <span class='post-count' dir='ltr'>(41)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://javascriptfornewbies.blogspot.com/2011/11/'> November </a> <span class='post-count' dir='ltr'>(15)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://javascriptfornewbies.blogspot.com/2011/10/'> October </a> <span class='post-count' dir='ltr'>(26)</span> <ul class='posts'> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/kill-that-javascript-error.html'>Kill That JavaScript Error</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/launch-investigation-into-your-browser.html'>Launch an Investigation Into Your Browser's JavaSc...</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/four-powerful-features-of-javascript.html'>Four Powerful Features of JavaScript Programming L...</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/pro-javascript-ides.html'>Pro JavaScript - IDEs</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/freelance-programming-and-freelance.html'>Freelance Programming and Freelance Programmers - ...</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/javascript-alert-every-web-master.html'>JavaScript Alert - Every Web Master Running JavaSc...</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/introduction-to-javascript.html'>An Introduction to JavaScript</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/javascript-improvements-in-modern-web.html'>Javascript Improvements in Modern Web Browsers</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/what-is-javascript.html'>What is JavaScript?</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/javascript-error-messages-just-might.html'>Javascript Error Messages Just Might Jostle Your N...</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/repairing-javascript-errors-piece-of.html'>Repairing Javascript Errors - a Piece of Cake</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/validating-form-input-in-javascript.html'>Validating Form Input in JavaScript</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/grow-your-subscribers-exponentially.html'>Grow Your Subscribers Exponentially With These Jav...</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/some-useful-javascript-tricks.html'>Some Useful JavaScript Tricks</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/ifuturz-offers-flash-development-custom.html'>iFuturz offers Flash Development, Custom PHP Devel...</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/using-external-javascript-files.html'>Using External JavaScript Files</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/some-important-things-about-mmo-rpg.html'>Some important things about MMO - RPG games</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/weight-loss-programs-positive-aspects.html'>Weight Loss Programs Positive aspects</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/why-central-banks-and-governments-want.html'>Why Central Banks and Governments want to keep the...</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/jquery-is-library-of-javascript.html'>JQuery is a library of JavaScript</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/oklahoma-city-divorce-attorney-five.html'>Oklahoma City Divorce Attorney - five Guidelines F...</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/showcases-slider.html'>Showcases slider</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/fancybox-jquery-plugin.html'>The FancyBox JQuery plugin</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/round-corners-with-javascript.html'>Round corners with Javascript</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/3d-tag-cloud-with-javascript-and-css.html'>3d tag cloud with Javascript and Css</a></li> <li><a href='https://javascriptfornewbies.blogspot.com/2011/10/mobile-application-development-for.html'>Mobile Application Development for Smartphone Andr...</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div class='clear'></div> </div> </div><div class='widget Profile' data-version='1' id='Profile1'> <h2>About Me</h2> <div class='widget-content'> <dl class='profile-datablock'> <dt class='profile-data'> <a class='profile-name-link g-profile' href='https://www.blogger.com/profile/04523759588252987709' rel='author' style='background-image: url(//www.blogger.com/img/logo-16.png);'> Bosss Corporation Blogs </a> </dt> <dd class='profile-textblock'>Experienced in the area of investing and internet marketing</dd> </dl> <a class='profile-link' href='https://www.blogger.com/profile/04523759588252987709' rel='author'>View my complete profile</a> <div class='clear'></div> </div> </div></div> </aside> </div> </div> </div> <div style='clear: both'></div> <!-- columns --> </div> <!-- main --> </div> </div> <div class='main-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> <footer> <div class='footer-outer'> <div class='footer-cap-top cap-top'> <div class='cap-left'></div> <div class='cap-right'></div> </div> <div class='fauxborder-left footer-fauxborder-left'> <div class='fauxborder-right footer-fauxborder-right'></div> <div class='region-inner footer-inner'> <div class='foot no-items section' id='footer-1'></div> <table border='0' cellpadding='0' cellspacing='0' class='section-columns columns-2'> <tbody> <tr> <td class='first columns-cell'> <div class='foot no-items section' id='footer-2-1'></div> </td> <td class='columns-cell'> <div class='foot no-items section' id='footer-2-2'></div> </td> </tr> </tbody> </table> <!-- outside of the include in order to lock Attribution widget --> <div class='foot section' id='footer-3' name='Footer'><div class='widget Attribution' data-version='1' id='Attribution1'> <div class='widget-content' style='text-align: center;'> Simple theme. Theme images by <a href='http://www.istockphoto.com/googleimages.php?id=11394138&platform=blogger&langregion=en' target='_blank'>luoman</a>. Powered by <a href='https://www.blogger.com' target='_blank'>Blogger</a>. </div> <div class='clear'></div> </div></div> </div> </div> <div class='footer-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </footer> <!-- content --> </div> </div> <div class='content-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </div> <script type='text/javascript'> window.setTimeout(function() { document.body.className = document.body.className.replace('loading', ''); }, 10); </script> <script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/181982280-widgets.js"></script> <script type='text/javascript'> window['__wavt'] = 'ACvIOeDRAB1ZqMPeqJzi6SMh326-:1788160291863';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d7977524528241239409','//javascriptfornewbies.blogspot.com/2011/10/some-useful-javascript-tricks.html','7977524528241239409'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '7977524528241239409', 'title': 'JavaScript for Newbies', 'url': 'https://javascriptfornewbies.blogspot.com/2011/10/some-useful-javascript-tricks.html', 'canonicalUrl': 'http://javascriptfornewbies.blogspot.com/2011/10/some-useful-javascript-tricks.html', 'homepageUrl': 'https://javascriptfornewbies.blogspot.com/', 'searchUrl': 'https://javascriptfornewbies.blogspot.com/search', 'canonicalHomepageUrl': 'http://javascriptfornewbies.blogspot.com/', 'blogspotFaviconUrl': 'https://javascriptfornewbies.blogspot.com/favicon.ico', 'bloggerUrl': 'https://www.blogger.com', 'hasCustomDomain': false, 'httpsEnabled': true, 'enabledCommentProfileImages': true, 'gPlusViewType': 'FILTERED_POSTMOD', 'adultContent': false, 'analyticsAccountNumber': '', 'encoding': 'UTF-8', 'locale': 'en', 'localeUnderscoreDelimited': 'en', 'languageDirection': 'ltr', 'isPrivate': false, 'isMobile': false, 'isMobileRequest': false, 'mobileClass': '', 'isPrivateBlog': false, 'isDynamicViewsAvailable': true, 'feedLinks': '\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22JavaScript for Newbies - Atom\x22 href\x3d\x22https://javascriptfornewbies.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22JavaScript for Newbies - RSS\x22 href\x3d\x22https://javascriptfornewbies.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22JavaScript for Newbies - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/7977524528241239409/posts/default\x22 /\x3e\n\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22JavaScript for Newbies - Atom\x22 href\x3d\x22https://javascriptfornewbies.blogspot.com/feeds/5319357163832593944/comments/default\x22 /\x3e\n', 'meTag': '', 'adsenseClientId': 'ca-pub-6767316913107449', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': true, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/5072387a26fe876a', 'plusOneApiSrc': 'https://apis.google.com/js/platform.js', 'disableGComments': true, 'interstitialAccepted': false, 'sharing': {'platforms': [{'name': 'Get link', 'key': 'link', 'shareMessage': 'Get link', 'target': ''}, {'name': 'Facebook', 'key': 'facebook', 'shareMessage': 'Share to Facebook', 'target': 'facebook'}, {'name': 'BlogThis!', 'key': 'blogThis', 'shareMessage': 'BlogThis!', 'target': 'blog'}, {'name': 'X', 'key': 'twitter', 'shareMessage': 'Share to X', 'target': 'twitter'}, {'name': 'Pinterest', 'key': 'pinterest', 'shareMessage': 'Share to Pinterest', 'target': 'pinterest'}, {'name': 'Email', 'key': 'email', 'shareMessage': 'Email', 'target': 'email'}], 'disableGooglePlus': true, 'googlePlusShareButtonWidth': 0, 'googlePlusBootstrap': '\x3cscript type\x3d\x22text/javascript\x22\x3ewindow.___gcfg \x3d {\x27lang\x27: \x27en\x27};\x3c/script\x3e'}, 'hasCustomJumpLinkMessage': false, 'jumpLinkMessage': 'Read more', 'pageType': 'item', 'postId': '5319357163832593944', 'pageName': 'Some Useful JavaScript Tricks', 'pageTitle': 'JavaScript for Newbies: Some Useful JavaScript Tricks'}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': 'Edit', 'linkCopiedToClipboard': 'Link copied to clipboard!', 'ok': 'Ok', 'postLink': 'Post Link'}}, {'name': 'template', 'data': {'name': 'Simple', 'localizedName': 'Simple', 'isResponsive': false, 'isAlternateRendering': false, 'isCustom': false, 'variant': 'literate', 'variantId': 'literate'}}, {'name': 'view', 'data': {'classic': {'name': 'classic', 'url': '?view\x3dclassic'}, 'flipcard': {'name': 'flipcard', 'url': '?view\x3dflipcard'}, 'magazine': {'name': 'magazine', 'url': '?view\x3dmagazine'}, 'mosaic': {'name': 'mosaic', 'url': '?view\x3dmosaic'}, 'sidebar': {'name': 'sidebar', 'url': '?view\x3dsidebar'}, 'snapshot': {'name': 'snapshot', 'url': '?view\x3dsnapshot'}, 'timeslide': {'name': 'timeslide', 'url': '?view\x3dtimeslide'}, 'isMobile': false, 'title': 'Some Useful JavaScript Tricks', 'description': ' JavaScript can be one of the most useful additions to any web page. It comes bundled with Microsoft Internet Explorer and Netscape Navigat...', 'url': 'https://javascriptfornewbies.blogspot.com/2011/10/some-useful-javascript-tricks.html', 'type': 'item', 'isSingleItem': true, 'isMultipleItems': false, 'isError': false, 'isPage': false, 'isPost': true, 'isHomepage': false, 'isArchive': false, 'isLabelSearch': false, 'postId': 5319357163832593944}}]); _WidgetManager._RegisterWidget('_NavbarView', new _WidgetInfo('Navbar1', 'navbar', document.getElementById('Navbar1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense2', 'crosscol', document.getElementById('AdSense2'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'lightboxEnabled': true, 'lightboxModuleUrl': 'https://www.blogger.com/static/v1/jsbin/321315994-lbx.js', 'lightboxCssUrl': 'https://www.blogger.com/static/v1/v-css/828616780-lightbox_bundle.css'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_SubscribeView', new _WidgetInfo('Subscribe1', 'sidebar-right-1', document.getElementById('Subscribe1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense1', 'sidebar-right-1', document.getElementById('AdSense1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogListView', new _WidgetInfo('BlogList1', 'sidebar-right-1', document.getElementById('BlogList1'), {'numItemsToShow': 0, 'totalItems': 6}, 'displayModeFull')); _WidgetManager._RegisterWidget('_FollowersView', new _WidgetInfo('Followers1', 'sidebar-right-1', document.getElementById('Followers1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogArchiveView', new _WidgetInfo('BlogArchive1', 'sidebar-right-1', document.getElementById('BlogArchive1'), {'languageDirection': 'ltr', 'loadingMessage': 'Loading\x26hellip;'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_ProfileView', new _WidgetInfo('Profile1', 'sidebar-right-1', document.getElementById('Profile1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AttributionView', new _WidgetInfo('Attribution1', 'footer-3', document.getElementById('Attribution1'), {}, 'displayModeFull')); </script> </body> </html>