Skip to content

Instantly share code, notes, and snippets.

@karimkhanp
Created January 3, 2014 09:39
Show Gist options
  • Save karimkhanp/8235406 to your computer and use it in GitHub Desktop.
Save karimkhanp/8235406 to your computer and use it in GitHub Desktop.
jquery onload
<?php
// A $( document ).ready() block.
$( document ).ready(function() {
console.log( "ready!" );
});
// ---------------
// Shorthand for $( document ).ready()
$(function() {
console.log( "ready!" );
});
?>
// ---------------
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$( document ).ready(function() {
console.log( "document loaded" );
});
$( window ).load(function() {
console.log( "window loaded" );
});
</script>
</head>
<body>
<iframe src="http://techcrunch.com"></iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment