‘Add to Favourites’ button javascript


Here is a simple code, that i found useful from dynamicdrive. You can use for 'Add to Favourites' button in HTML. Add them in your head tag: <script type="text/javascript"> /*********************************************** * Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/Continue reading ‘Add to Favourites’ button javascript

How to get the javascript version?


Javascript is evolving. With newer version, more commands, new functionalities gets added. To get to know the version of javascript your browser supports, just save the following code as html and load it in your browser: <script type="text/javascript"> var jsver = 1.0; </script> <script language="Javascript1.1"> jsver = 1.1; </script> <script language="Javascript1.2"> jsver = 1.2; </script> … Continue reading How to get the javascript version?

Javascript pause method: To create delays in javascripts


Creating delays in javascript can be very essential under certain specific scenarios, though i would recommend you to avoid it in most cases. The right way to create a delay would be by using setTimeOut method in javascript, as below: setTimeout("alert('hello world')",1500); // shows alertbox after 1500 milliseconds The lazy way or to be precise … Continue reading Javascript pause method: To create delays in javascripts

ASP .Net Menu using ordered list – ul, li concept


I give a different approach to menu creation, in my ASP .Net project. The main wins being the performance and ease of use. Asp menu is pretty messy when you look at the code behind and the page size it adds. But use this concept only if performance is a critical factor. Concept: •    Use … Continue reading ASP .Net Menu using ordered list – ul, li concept

How to determine whether Javascript is enabled?


There are a lot of approaches to this. Lets take them one at a time: Using NOSCRIPT tag: You can write a noscript tag just before your script tag to display the user a warning message. Check the code below, wherein the user will be redirected to another page if javascript is disabled: <html> <head> … Continue reading How to determine whether Javascript is enabled?

Javascript to check any redirection to another page


When the user had made some changes in the page and accidentally clicks some links on the page, you might want to warn the user about the redirection and ask his permission for the operation. Javascript makes it quite simple to do this operation, with the help of window.onbeforeunload(): window.onbeforeunload = checkRedirection; function checkRedirection (evt) … Continue reading Javascript to check any redirection to another page

Javascript to maximise window on load


Well this is simple script to get your browser maximised onload: <html> <head> <script language="JavaScript"> window.onload = maxWindow; function maxWindow() { window.moveTo(0,0); if (document.all) { top.window.resizeTo(screen.availWidth,screen.availHeight); } else if (document.layers||document.getElementById) { if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth) { top.window.outerHeight = screen.availHeight; top.window.outerWidth = screen.availWidth; } } } </script> </head> <body>Testing</body> </html> I just tested it it IE. Hope this … Continue reading Javascript to maximise window on load