Check password safety with JavaScript while typing

You can show password strength to your visitors while typing before even submitting the page to the webserver. There are four character groups: letters, caps, numbers and symbols. A password which is longer than 7 characters and contains at least one character from each group is strong vz537gnjua. A password which is at least 8 character long and has all characters from one group is weak (but not very weak). A password which contains all characters from one group and at least 20 characters long is also strong.

Redirect webpages with HTML, PHP, .htaccess, Java+Script, CGI-Perl, ASP.NET and ColdFusion

Here are examples of code how to redirect an old page/url/domain to a new one with most popular client+server side programming/scripting languages. We use 301 http status code (permanent redirect). If you need temporary redirection use 302 status code instead of 301. It is better to prefer server-side redirection, because some clients are surfing with javascript and http-refresh disabled browsers. Do not forget to test your code first!

.htacces and Mod_Rewrite (Apache Webserver)

Preload images with JavaScript or CSS

I have a small website with two background images for top menu. When I bring mouse first time over a menu element it takes 2-3 seconds that second background image loaded (style link:hover background: url(secondimg.png)). For this short time user see nothing, of course it is annoying. To escape this situation I want to preload all images inklusive background images for menu elements, links, divs etc. Is there a very easy and short javascript or css trick? Thanks for any help!

Google Analytics to track visitors if javascript disabled?

Can Google Analystics track website visitors when clients browsers javascript is disabled? I dont see an alternative to < script > tag like < noscript > or < img > etc. If not how can I trust Google Analytics that they count all visitors?

Hide your email address + mailto link with javascript from spammer

Of course you can write you email on an gif or jpeg image. But you cant give a mailto:link without your email appears clearly. Therefore use javascript, your email appears to visitors as a text but appears spam-bots crawlers as javascript code, which they ignore as usual.

	var email = ['i','n','f','o','@', 's', 'i', 't', 'e', '.', 'c', 'o', 'm']; 
	var link = "";
	for(i=0; i'+link+'');

Change background color onmouseover with Javascript

You can change background color of this div just bringing your mouse over colors.


Javascript Frameworks and Ajax Jquery

Hello I am a beginner and want to learn all web trends. I see that in last time ajax getting very popular and I tried to learn it by trying myself. But it is very complicated for me because of too much code and I dont know where to start how to exercise at home.

Is there a step-by-step tutorial which shows why we need ajax and how to start with ajax? It would be perfect if there would some small jobs to try with ajax.

Test a webpage with IE5.5, IE6, IE7 and different javascript and css versions

I have just found a free software to test webpages with different Internet Explorer versions. Did anybody really test it ? Can this really simulate all css and javascript versions correctly on both XP and Vista?

This is the url where I downloaded IETester:

Thank you!

Sleep Function for JavaScript like PHP

I need to implement a general sleep function replacement for javascript. It should be possible to call it multiple times on a page. I googled and found some code on ozzu forums, which didnt work for me. I get alert messages immediately without waiting 2 or 5 seconds. I tried it (with MSIE+FF) as following :

 function sleep(delay)
     var start = new Date().getTime();
     while (new Date().getTime() < start + delay);

Random tip / info-box with javascript array

This is reserved-place for a random tip. 
Put it somewhere on your website. 
In this example p must be placed above javascript-code.
Syndicate content is a free online community for webdevelopers and beginners. Anybody can share their code, articles, tips, tutorials, code-examples or other webdesign related material on the site. Newbies can submit their questions and reply to existing questions. CW does not guarantee or warrant reliability of code, data and information published on the site. Use the site on your own risk. The site takes no responsibility of direct or indirect loss or any kind of harm to its users. The site also doesn't take responsibility of infected files or source code with any kind of infection or viruses, worms, spywares, malwares, trojan horses. CW reserves the right to edit, move, or delete any of content for any reason.