Demo Dom Ready
$() = $(document).ready() = $().ready() = $.ready() = document.observe('dom:loaded')
Geneva supports checking the DOMLoaded state via all 5 of the above methods
Check out the code below to see what runs this page.
$(document).ready(); contribution by Al MacDonald Hyper-Metrix & ProcessingJS
div set 1 : 1
div set 1 : 2
div set 1 : 3
// Alt 1: $(function () {
// Alt 2: $.ready(
//$(document).ready(function () {
$.ready(function () {
//$(document);
//console.log( $() );
$().mouseover( function (e) {
$('#clientX').val(e.clientX);
$('#clientY').val(e.clientY);
});
$('input.change_my_color')
.focus( function () {
$(this).highlight();
})
.blur( function () {
console.log( 'value:' + $F($(this)) );
});
$('input[type="button"]')
.click( function () {
var tofocus = this.id.replace('button_set1', 'input_set2');
console.log(tofocus);
$(tofocus).focus();
$(this).attr('value', 'clicked!');
//$(this).value = 'Clicked!';
});
$('.row2')
.click( function () {
$('.row1').click();
});
$('.is_ajax_button')
.click( function () {
var dest = $(this).id.replace('span_button1_', 'div_set1_');
var show = $(this).id.split('_')[2] - 1;
$('#' + dest).load('xhr2.php', function (xhr) {
var libs = xhr.evalJSON();
return libs[show].library + ' : ' + libs[show].url;
});
});
$('form_events_demo')
.submit( function () {
console.log( this.serialize() );
});
});