Ajax - XMLHtmlRequest with "TOGGLE" effect
<script type="text/javascript">
function script()
{
var e = document.getElementById();
if(e.innerHTML == "")
{
var oRequest;
try {
oRequest=new XMLHttpRequest();
} catch (e) {
try {
oRequest=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
oRequest=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("AJAX IS NOT SUPPORTED");
return false;
}
}
}
oRequest.onreadystatechange=function() {
if(oRequest.readyState==4)
{
document.getElementById().innerHTML = oRequest.responseText;
}
}
oRequest.open("GET","",true);
oRequest.send(null);
}
else
{e.innerHTML = "";}
}
</script>
Ajax - XMLHtmlRequest
<script type="text/javascript">
function script()
{
var e = document.getElementById("");
var oRequest;
try {
oRequest=new XMLHttpRequest();
} catch (e) {
try {
oRequest=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
oRequest=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("YOUR BROWSER DOESN'T SUPPORT AJAX!");
return false;
}
}
}
oRequest.onreadystatechange=function() {
if(oRequest.readyState==4)
{
document.getElementById("").innerHTML = oRequest.responseText;
}
}
oRequest.open("GET",,true);
oRequest.send(null);
}
</script>
Unify Div Heights (using jQuery)
// Make the height of all the innerDivs the same height based on the tallest one.
function unifyHeights()
{
var maxHeight = 0;
$('div#OuterContainer').children('div').each(function(){
var height = $(this).outerHeight();
//alert(height);
if ( height > maxHeight ) { maxHeight = height; }
});
$('div.innerDivs').css('height', maxHeight);
}
Added to JS by Michael D. Noga
Get Value of Select and Load external file to div (jQuery)
$(document).ready(function(){
$('#contactFormSelect :selected').val();
$("#contactFormSelect").change(function(){
$('#formLoader').load($('#contactFormSelect').val());
});
});
Added to JS by Mark Evans
Textarea Character Count (jQuery)
// controls character input/counter
$('textarea#body').keyup(function() {
var charLength = $(this).val().length;
// Displays count
$('span#charCount').html(charLength + ' of 250 characters used');
// Alerts when 250 characters is reached
if($(this).val().length > 250)
$('span#charCount').html('<strong>You may only have up to 250 characters.</strong>');
});
Added to JS by Mark Evans
jQuery Action
<script type="text/javascript">
$(document).ready(function() {
/*place jQuery actions here*/
<<**SelectionInsertionPlaceholder**>>
});
</script>
Added to JS by Matthew Hunt
JavaScript Include
<script type="text/javascript" src="<<**SelectionInsertionPlaceholder**>>"></script>