Free Javascript

jQuery Cheat Sheet V1.6

jQuery Cheat Sheet v1.6

jQuery Cheat Sheet is here. This is a simple jQuery cheat sheet for you to use while coding using jQuery. I have included a PDF version which each element is clickable / linked to the jQuery website for information on which Selector, Attribute, Event, etc.. you are trying to code. I have also included JPG Image files for download but you will lose the linking functionality.

Download - jQuery_Cheat_Sheet.pdf
Downloaded 299 times Password: mkwebdesign

Free Javascript Random Text Generator

This is a simple piece of Free Javascript which will place Random Text where you want it in your webpage. Simply put the Code where you want your text to display, replacing the Your Text with the text you want to use.

Code:
<script type=”text/javascript”>
var text=new Array()
text[0]=’Your Text 1′;
text[1]=’Your Text 2′;
text[2]=’Your Text 3′;
text[3]=’Your Text 4′;
text[4]=’Your Text 5′;
text[5]=’Your Text 6′;
text[6]=’Your Text 7′;
text[7]=’Your Text 8′;
text[8]=’Your Text 9′;
text[9]=’Your Text 10′;
var xy=Math.floor(Math.random()*text.length);
document.write(text[xy]);
</script>

Example:

Free Javascript Title Bar Scroller

This is a simple piece of Free Javascript which will make the Title of your webpage in the Title Bar Scroll the site’s title. You can use this to display long Titles. Place the following code between the <head> and </head> section.

Code:
<script type=”text/javascript”>
var repeat=0 // Change this to 1 to run indefinitely, 0 Scrolls one
var title=document.title
var leng=title.length
var start=1
function titlemove() {
titl=title.substring(start, leng) + title.substring(0, start)
document.title=titl
start++
if (start==leng+1) {
start=0
if (repeat==0)
return
}
setTimeout(“titlemove()”,150) // Adjust this number to adjust the speed of the scroller (Higher is slower, Lower is Faster)
}
if (document.title)
titlemove()
</script>

Examples:

Click Here (New Window)

Javascript Alert Box

Simple JavaScript which will generate a simple alert box based on clicking a link or a form button. Useful for alerting users for missing fields, displaying a message on document open or close, or informing users they’ve clicked a link. Examples and Code are below.

Code:

Button:
<form><input type=”button” value=”Open Alert Box” onClick=’alert(“Place Your message here… \n Click OK to contine.”)’></form>

Link:
<a href=’javascript:onClick=alert(“Place Your message here… \n Click OK to contine.”)’>Open Alert Box</a>

Examples:

Button:

Link:
Open Alert Box

JavaScript Blood Alcohol Concentration Estimator And Calculator

This calculator will estimate your Blood / Breath Alcohol Level based on the amount of Alcoholic Drinks (Beer and/or Spirits), Time, and Weight of a person. Please complete the form and then press calculate to obtain a Blood Alcohol estimate. You can also view a Printer / Mobile Friendly Version. This calculator was programmed using HTML and JavaScript. You can copy the code by viewing this documents source or download the file below.

  JavaScript Blood Alcohol Calculator (1.8 KB, 212 hits)